Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: src/plugin/PluginClass.cpp

Issue 5081266177179648: Issue 1104 - Cannot uncheck Disable on website option in tool bar (Closed)
Patch Set: Created Feb. 23, 2015, 12:40 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/plugin/PluginClass.cpp
diff --git a/src/plugin/PluginClass.cpp b/src/plugin/PluginClass.cpp
index a275b06157b4be9cb2b26299d99822bbf5acb663..51c54d1a1e57a10eaf80f8f2495a0cea08aea183 100644
--- a/src/plugin/PluginClass.cpp
+++ b/src/plugin/PluginClass.cpp
@@ -1261,16 +1261,7 @@ void CPluginClass::DisplayPluginMenu(HMENU hMenu, int nToolbarCmdID, POINT pt, U
}
case ID_MENU_DISABLE_ON_SITE:
{
- CPluginSettings* settings = CPluginSettings::GetInstance();
- std::wstring urlString = GetTab()->GetDocumentUrl();
- if (client->IsWhitelistedUrl(urlString))
- {
- settings->RemoveWhiteListedDomain(ToCString(client->GetHostFromUrl(urlString)));
- }
- else
- {
- settings->AddWhiteListedDomain(ToCString(client->GetHostFromUrl(urlString)));
- }
+ client->ToggleWhitelisting(GetTab()->GetDocumentUrl());
GetBrowser()->Refresh();
}
default:
@@ -1302,7 +1293,7 @@ bool CPluginClass::SetMenuBar(HMENU hMenu, const std::wstring& url)
{
ctext = dictionary->Lookup("menu", "menu-disable-on-site");
// Is domain in white list?
- ReplaceString(ctext, L"?1?", client->GetHostFromUrl(url));
+ ReplaceString<std::wstring>(ctext, L"?1?", client->GetHostFromUrl(url));
Eric 2015/02/26 16:14:10 Explicit type in template function
Eric 2015/02/26 18:16:01 We need to display the same name in the popup menu
if (client->IsWhitelistedUrl(GetTab()->GetDocumentUrl()))
{
fmii.fState = MFS_CHECKED | MFS_ENABLED;

Powered by Google App Engine
This is Rietveld