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

Side by Side Diff: src/plugin/PluginClass.cpp

Issue 5652794446970880: Rely on libadblockplus for domain extraction (Closed)
Patch Set: Use libadblockplus for domain extraction in APP as well Created April 22, 2014, 7:48 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 #include "PluginStdAfx.h" 1 #include "PluginStdAfx.h"
2 2
3 #include "PluginClass.h" 3 #include "PluginClass.h"
4 #include "PluginSettings.h" 4 #include "PluginSettings.h"
5 #include "PluginSystem.h" 5 #include "PluginSystem.h"
6 #ifdef SUPPORT_FILTER 6 #ifdef SUPPORT_FILTER
7 #include "PluginFilter.h" 7 #include "PluginFilter.h"
8 #endif 8 #endif
9 #include "PluginMimeFilterClient.h" 9 #include "PluginMimeFilterClient.h"
10 #include "PluginClient.h" 10 #include "PluginClient.h"
(...skipping 1315 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 } 1326 }
1327 } 1327 }
1328 break; 1328 break;
1329 } 1329 }
1330 case ID_MENU_DISABLE_ON_SITE: 1330 case ID_MENU_DISABLE_ON_SITE:
1331 { 1331 {
1332 CPluginSettings* settings = CPluginSettings::GetInstance(); 1332 CPluginSettings* settings = CPluginSettings::GetInstance();
1333 CString urlString = GetTab()->GetDocumentUrl(); 1333 CString urlString = GetTab()->GetDocumentUrl();
1334 if (client->IsWhitelistedUrl(std::wstring(urlString))) 1334 if (client->IsWhitelistedUrl(std::wstring(urlString)))
1335 { 1335 {
1336 settings->RemoveWhiteListedDomain(ExtractDomain(urlString)); 1336 settings->RemoveWhiteListedDomain(client->GetHostFromUrl(urlString.GetSt ring()).c_str());
1337 } 1337 }
1338 else 1338 else
1339 { 1339 {
1340 settings->AddWhiteListedDomain(ExtractDomain(urlString)); 1340 settings->AddWhiteListedDomain(client->GetHostFromUrl(urlString.GetStrin g()).c_str());
1341 } 1341 }
1342 GetBrowser()->Refresh(); 1342 GetBrowser()->Refresh();
1343 } 1343 }
1344 case ID_MENU_ACCEPTABLE_ADS: 1344 case ID_MENU_ACCEPTABLE_ADS:
1345 { 1345 {
1346 if (client->AcceptableAdsStatus()) 1346 if (client->AcceptableAdsStatus())
1347 { 1347 {
1348 client->RemoveSubscription(client->GetPref(L"subscriptions_exceptionsurl ", L"")); 1348 client->RemoveSubscription(client->GetPref(L"subscriptions_exceptionsurl ", L""));
1349 } 1349 }
1350 else 1350 else
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
1389 miiSep.fType = MFT_SEPARATOR; 1389 miiSep.fType = MFT_SEPARATOR;
1390 1390
1391 CPluginClient* client = CPluginClient::GetInstance(); 1391 CPluginClient* client = CPluginClient::GetInstance();
1392 1392
1393 CPluginSettings* settings = CPluginSettings::GetInstance(); 1393 CPluginSettings* settings = CPluginSettings::GetInstance();
1394 1394
1395 #ifdef SUPPORT_WHITELIST 1395 #ifdef SUPPORT_WHITELIST
1396 { 1396 {
1397 ctext = dictionary->Lookup("menu", "menu-disable-on-site"); 1397 ctext = dictionary->Lookup("menu", "menu-disable-on-site");
1398 // Is domain in white list? 1398 // Is domain in white list?
1399 ReplaceString(ctext, L"?1?", ExtractDomain(url).GetString()); 1399 ReplaceString(ctext, L"?1?", client->GetHostFromUrl(url.GetString()));
1400 if (client->IsWhitelistedUrl(std::wstring(GetTab()->GetDocumentUrl()))) 1400 if (client->IsWhitelistedUrl(std::wstring(GetTab()->GetDocumentUrl())))
1401 { 1401 {
1402 fmii.fState = MFS_CHECKED | MFS_ENABLED; 1402 fmii.fState = MFS_CHECKED | MFS_ENABLED;
1403 } 1403 }
1404 else 1404 else
1405 { 1405 {
1406 fmii.fState = MFS_UNCHECKED | MFS_ENABLED; 1406 fmii.fState = MFS_UNCHECKED | MFS_ENABLED;
1407 } 1407 }
1408 fmii.fMask = MIIM_STRING | MIIM_STATE; 1408 fmii.fMask = MIIM_STRING | MIIM_STATE;
1409 fmii.dwTypeData = const_cast<LPWSTR>(ctext.c_str()); 1409 fmii.dwTypeData = const_cast<LPWSTR>(ctext.c_str());
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1997 } 1997 }
1998 } 1998 }
1999 } 1999 }
2000 2000
2001 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 2001 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
2002 } 2002 }
2003 2003
2004 return hTabWnd; 2004 return hTabWnd;
2005 2005
2006 } 2006 }
OLDNEW

Powered by Google App Engine
This is Rietveld