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

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

Issue 5109791353470976: Issue #1234 - standardize some string conversions (Closed)
Patch Set: Created Aug. 6, 2014, 8:19 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/plugin/AdblockPlusDomTraverser.cpp ('k') | src/plugin/PluginFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "PluginFilter.h" 6 #include "PluginFilter.h"
7 #include "PluginMimeFilterClient.h" 7 #include "PluginMimeFilterClient.h"
8 #include "PluginClient.h" 8 #include "PluginClient.h"
9 #include "PluginClientFactory.h" 9 #include "PluginClientFactory.h"
10 #include "PluginMutex.h" 10 #include "PluginMutex.h"
(...skipping 1324 matching lines...) Expand 10 before | Expand all | Expand 10 after
1335 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_NAVIGATION, PLUGIN_ERROR_NAVIGATION _SETTINGS, "Navigation::Failed") 1335 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_NAVIGATION, PLUGIN_ERROR_NAVIGATION _SETTINGS, "Navigation::Failed")
1336 } 1336 }
1337 } 1337 }
1338 } 1338 }
1339 break; 1339 break;
1340 } 1340 }
1341 case ID_MENU_DISABLE_ON_SITE: 1341 case ID_MENU_DISABLE_ON_SITE:
1342 { 1342 {
1343 CPluginSettings* settings = CPluginSettings::GetInstance(); 1343 CPluginSettings* settings = CPluginSettings::GetInstance();
1344 CString urlString = GetTab()->GetDocumentUrl(); 1344 CString urlString = GetTab()->GetDocumentUrl();
1345 if (client->IsWhitelistedUrl(std::wstring(urlString))) 1345 if (client->IsWhitelistedUrl(to_wstring(urlString)))
1346 { 1346 {
1347 settings->RemoveWhiteListedDomain(client->GetHostFromUrl(urlString.GetSt ring()).c_str()); 1347 settings->RemoveWhiteListedDomain(to_CString(client->GetHostFromUrl(to_w string(urlString))));
1348 } 1348 }
1349 else 1349 else
1350 { 1350 {
1351 settings->AddWhiteListedDomain(client->GetHostFromUrl(urlString.GetStrin g()).c_str()); 1351 settings->AddWhiteListedDomain(to_CString(client->GetHostFromUrl(to_wstr ing(urlString))));
1352 } 1352 }
1353 GetBrowser()->Refresh(); 1353 GetBrowser()->Refresh();
1354 } 1354 }
1355 default: 1355 default:
1356 break; 1356 break;
1357 } 1357 }
1358 1358
1359 // Invalidate and redraw the control 1359 // Invalidate and redraw the control
1360 UpdateStatusBar(); 1360 UpdateStatusBar();
1361 } 1361 }
(...skipping 21 matching lines...) Expand all
1383 memset(&miiSep, 0, sizeof(MENUITEMINFO)); 1383 memset(&miiSep, 0, sizeof(MENUITEMINFO));
1384 miiSep.cbSize = sizeof(MENUITEMINFO); 1384 miiSep.cbSize = sizeof(MENUITEMINFO);
1385 miiSep.fMask = MIIM_TYPE | MIIM_FTYPE; 1385 miiSep.fMask = MIIM_TYPE | MIIM_FTYPE;
1386 miiSep.fType = MFT_SEPARATOR; 1386 miiSep.fType = MFT_SEPARATOR;
1387 1387
1388 CPluginClient* client = CPluginClient::GetInstance(); 1388 CPluginClient* client = CPluginClient::GetInstance();
1389 CPluginSettings* settings = CPluginSettings::GetInstance(); 1389 CPluginSettings* settings = CPluginSettings::GetInstance();
1390 { 1390 {
1391 ctext = dictionary->Lookup("menu", "menu-disable-on-site"); 1391 ctext = dictionary->Lookup("menu", "menu-disable-on-site");
1392 // Is domain in white list? 1392 // Is domain in white list?
1393 ReplaceString(ctext, L"?1?", client->GetHostFromUrl(url.GetString())); 1393 ReplaceString(ctext, L"?1?", client->GetHostFromUrl(to_wstring(url)));
1394 if (client->IsWhitelistedUrl(std::wstring(GetTab()->GetDocumentUrl()))) 1394 if (client->IsWhitelistedUrl(to_wstring(GetTab()->GetDocumentUrl())))
1395 { 1395 {
1396 fmii.fState = MFS_CHECKED | MFS_ENABLED; 1396 fmii.fState = MFS_CHECKED | MFS_ENABLED;
1397 } 1397 }
1398 else 1398 else
1399 { 1399 {
1400 fmii.fState = MFS_UNCHECKED | MFS_ENABLED; 1400 fmii.fState = MFS_UNCHECKED | MFS_ENABLED;
1401 } 1401 }
1402 fmii.fMask = MIIM_STRING | MIIM_STATE; 1402 fmii.fMask = MIIM_STRING | MIIM_STATE;
1403 fmii.dwTypeData = const_cast<LPWSTR>(ctext.c_str()); 1403 fmii.dwTypeData = const_cast<LPWSTR>(ctext.c_str());
1404 fmii.cch = static_cast<UINT>(ctext.size()); 1404 fmii.cch = static_cast<UINT>(ctext.size());
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
1611 // use the disable icon as defualt, if the client doesn't exists 1611 // use the disable icon as defualt, if the client doesn't exists
1612 HICON hIcon = GetIcon(ICON_PLUGIN_DEACTIVATED); 1612 HICON hIcon = GetIcon(ICON_PLUGIN_DEACTIVATED);
1613 1613
1614 CPluginTab* tab = GetTab(::GetCurrentThreadId()); 1614 CPluginTab* tab = GetTab(::GetCurrentThreadId());
1615 if (tab) 1615 if (tab)
1616 { 1616 {
1617 CPluginClient* client = CPluginClient::GetInstance(); 1617 CPluginClient* client = CPluginClient::GetInstance();
1618 if (!CPluginSettings::GetInstance()->IsPluginEnabled()) 1618 if (!CPluginSettings::GetInstance()->IsPluginEnabled())
1619 { 1619 {
1620 } 1620 }
1621 else if (client->IsWhitelistedUrl(std::wstring(url))) 1621 else if (client->IsWhitelistedUrl(to_wstring(url)))
1622 { 1622 {
1623 hIcon = GetIcon(ICON_PLUGIN_DISABLED); 1623 hIcon = GetIcon(ICON_PLUGIN_DISABLED);
1624 } 1624 }
1625 else 1625 else
1626 { 1626 {
1627 CPluginSettings* settings = CPluginSettings::GetInstance(); 1627 CPluginSettings* settings = CPluginSettings::GetInstance();
1628 hIcon = GetIcon(ICON_PLUGIN_ENABLED); 1628 hIcon = GetIcon(ICON_PLUGIN_ENABLED);
1629 } 1629 }
1630 } 1630 }
1631 return hIcon; 1631 return hIcon;
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after
1959 } 1959 }
1960 } 1960 }
1961 } 1961 }
1962 1962
1963 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 1963 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
1964 } 1964 }
1965 1965
1966 return hTabWnd; 1966 return hTabWnd;
1967 1967
1968 } 1968 }
OLDNEW
« no previous file with comments | « src/plugin/AdblockPlusDomTraverser.cpp ('k') | src/plugin/PluginFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld