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

Unified Diff: Shared/PluginClass.cpp

Issue 9998007: Initial libadblockplus integration (Closed)
Patch Set: Whitelisting management Created April 11, 2013, 9:06 a.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
« no previous file with comments | « Shared/AdblockPlusClient.h ('k') | Shared/PluginConfiguration.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Shared/PluginClass.cpp
===================================================================
--- a/Shared/PluginClass.cpp
+++ b/Shared/PluginClass.cpp
@@ -1443,33 +1443,6 @@
default:
-#ifdef SUPPORT_WHITELIST
- {
- if (nCommand >= WM_WHITELIST_DOMAIN && nCommand <= WM_WHITELIST_DOMAIN_MAX)
- {
- CPluginSettings* settings = CPluginSettings::GetInstance();
-
- CString domain;
-
- s_criticalSectionLocal.Lock();
- {
- domain = s_menuDomains[nCommand];
- }
- s_criticalSectionLocal.Unlock();
-
- if (settings->IsWhiteListedDomain(domain))
- {
- settings->AddWhiteListedDomain(domain, 3, true);
- }
- else
- {
- settings->AddWhiteListedDomain(domain, 1, true);
- }
-
- client->ClearWhiteListCache();
- }
- }
-#endif // SUPPORT_WHITELIST
break;
}
@@ -1562,107 +1535,6 @@
UINT index = WM_WHITELIST_DOMAIN;
- // Add domains from history
- if (client)
- {
- bool isFirst = true;
-
- TDomainHistory domainHistory = settings->GetDomainHistory();
-
- CString documentDomain = tab->GetDocumentDomain();
-
- if (CPluginClient::IsValidDomain(documentDomain))
- {
- CString documentDomainT = documentDomain;
-
- for (TDomainHistory::const_reverse_iterator it = domainHistory.rbegin(); it != domainHistory.rend(); ++it)
- {
- if (documentDomain == it->first)
- {
- if (isFirst)
- {
- fmii.fState = MFS_ENABLED;
- fmii.fMask |= MIIM_SUBMENU;
- fmii.hSubMenu = ::CreateMenu();
- }
-
- MENUITEMINFO smii;
- memset(&smii, 0, sizeof(MENUITEMINFO));
- smii.cbSize = sizeof(MENUITEMINFO);
-
- smii.fMask = MIIM_STRING | MIIM_ID;
- smii.dwTypeData = documentDomainT.GetBuffer();
- smii.cch = documentDomainT.GetLength();
- smii.wID = index;
-
- bool isWhitelisted = settings->IsWhiteListedDomain(it->first);
- if (isWhitelisted)
- {
- smii.fMask |= MIIM_STATE;
- smii.fState |= MFS_CHECKED;
- }
-
- if (isFirst)
- {
- smii.fMask |= MIIM_STATE;
- smii.fState |= MFS_DEFAULT;
-
- isFirst = false;
- }
-
- InsertMenuItem(fmii.hSubMenu, index, FALSE, &smii);
-
- s_criticalSectionLocal.Lock();
- {
- s_menuDomains[index++] = documentDomain;
- }
- s_criticalSectionLocal.Unlock();
- }
- }
- }
-
- // Add last domains
- for (TDomainHistory::const_reverse_iterator it = domainHistory.rbegin(); it != domainHistory.rend(); ++it)
- {
- if (it->first != documentDomain)
- {
- if (isFirst)
- {
- fmii.fMask |= MIIM_STATE | MIIM_SUBMENU;
- fmii.fState = MFS_ENABLED;
- fmii.hSubMenu = CreateMenu();
-
- isFirst = false;
- }
-
- CString domain = it->first;
-
- MENUITEMINFO smii;
- memset(&smii, 0, sizeof(MENUITEMINFO));
- smii.cbSize = sizeof(MENUITEMINFO);
- smii.fMask = MIIM_STRING | MIIM_ID;
- smii.dwTypeData = domain.GetBuffer();
- smii.cch = domain.GetLength();
- smii.wID = index;
-
- bool isWhitelisted = settings->IsWhiteListedDomain(it->first);
- if (isWhitelisted)
- {
- smii.fMask |= MIIM_STATE;
- smii.fState |= MFS_CHECKED;
- }
-
- ::InsertMenuItem(fmii.hSubMenu, index, FALSE, &smii);
-
- s_criticalSectionLocal.Lock();
- {
- s_menuDomains[index++] = it->first;
- }
- s_criticalSectionLocal.Unlock();
- }
- }
- }
-
::SetMenuItemInfo(hMenu, ID_WHITELISTDOMAIN, FALSE, &fmii);
}
#else
« no previous file with comments | « Shared/AdblockPlusClient.h ('k') | Shared/PluginConfiguration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld