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

Delta Between Two Patch Sets: src/plugin/PluginClass.cpp

Issue 5558809044975616: Noissue - Dead code removal (Closed)
Left Patch Set: Created Oct. 2, 2014, 9:57 p.m.
Right Patch Set: Created Oct. 7, 2014, 3:56 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/plugin/PluginClass.h ('k') | src/plugin/PluginStdAfx.h » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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 1339 matching lines...) Expand 10 before | Expand all | Expand 10 after
1350 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_NAVIGATION, PLUGIN_ERROR_NAVIGATION _SETTINGS, "Navigation::Failed") 1350 DEBUG_ERROR_LOG(hr, PLUGIN_ERROR_NAVIGATION, PLUGIN_ERROR_NAVIGATION _SETTINGS, "Navigation::Failed")
1351 } 1351 }
1352 } 1352 }
1353 } 1353 }
1354 break; 1354 break;
1355 } 1355 }
1356 case ID_MENU_DISABLE_ON_SITE: 1356 case ID_MENU_DISABLE_ON_SITE:
1357 { 1357 {
1358 CPluginSettings* settings = CPluginSettings::GetInstance(); 1358 CPluginSettings* settings = CPluginSettings::GetInstance();
1359 CString urlString = GetTab()->GetDocumentUrl(); 1359 CString urlString = GetTab()->GetDocumentUrl();
1360 if (client->IsWhitelistedUrl(std::wstring(urlString))) 1360 if (client->IsWhitelistedUrl(to_wstring(urlString)))
1361 { 1361 {
1362 settings->RemoveWhiteListedDomain(client->GetHostFromUrl(urlString.GetSt ring()).c_str()); 1362 settings->RemoveWhiteListedDomain(to_CString(client->GetHostFromUrl(to_w string(urlString))));
1363 } 1363 }
1364 else 1364 else
1365 { 1365 {
1366 settings->AddWhiteListedDomain(client->GetHostFromUrl(urlString.GetStrin g()).c_str()); 1366 settings->AddWhiteListedDomain(to_CString(client->GetHostFromUrl(to_wstr ing(urlString))));
1367 } 1367 }
1368 GetBrowser()->Refresh(); 1368 GetBrowser()->Refresh();
1369 } 1369 }
1370 default: 1370 default:
1371 break; 1371 break;
1372 } 1372 }
1373 1373
1374 // Invalidate and redraw the control 1374 // Invalidate and redraw the control
1375 UpdateStatusBar(); 1375 UpdateStatusBar();
1376 } 1376 }
(...skipping 14 matching lines...) Expand all
1391 memset(&miiSep, 0, sizeof(MENUITEMINFO)); 1391 memset(&miiSep, 0, sizeof(MENUITEMINFO));
1392 miiSep.cbSize = sizeof(MENUITEMINFO); 1392 miiSep.cbSize = sizeof(MENUITEMINFO);
1393 miiSep.fMask = MIIM_TYPE | MIIM_FTYPE; 1393 miiSep.fMask = MIIM_TYPE | MIIM_FTYPE;
1394 miiSep.fType = MFT_SEPARATOR; 1394 miiSep.fType = MFT_SEPARATOR;
1395 1395
1396 CPluginClient* client = CPluginClient::GetInstance(); 1396 CPluginClient* client = CPluginClient::GetInstance();
1397 CPluginSettings* settings = CPluginSettings::GetInstance(); 1397 CPluginSettings* settings = CPluginSettings::GetInstance();
1398 { 1398 {
1399 ctext = dictionary->Lookup("menu", "menu-disable-on-site"); 1399 ctext = dictionary->Lookup("menu", "menu-disable-on-site");
1400 // Is domain in white list? 1400 // Is domain in white list?
1401 ReplaceString(ctext, L"?1?", client->GetHostFromUrl(url.GetString())); 1401 ReplaceString(ctext, L"?1?", client->GetHostFromUrl(to_wstring(url)));
1402 if (client->IsWhitelistedUrl(std::wstring(GetTab()->GetDocumentUrl()))) 1402 if (client->IsWhitelistedUrl(to_wstring(GetTab()->GetDocumentUrl())))
1403 { 1403 {
1404 fmii.fState = MFS_CHECKED | MFS_ENABLED; 1404 fmii.fState = MFS_CHECKED | MFS_ENABLED;
1405 } 1405 }
1406 else 1406 else
1407 { 1407 {
1408 fmii.fState = MFS_UNCHECKED | MFS_ENABLED; 1408 fmii.fState = MFS_UNCHECKED | MFS_ENABLED;
1409 } 1409 }
1410 fmii.fMask = MIIM_STRING | MIIM_STATE; 1410 fmii.fMask = MIIM_STRING | MIIM_STATE;
1411 fmii.dwTypeData = const_cast<LPWSTR>(ctext.c_str()); 1411 fmii.dwTypeData = const_cast<LPWSTR>(ctext.c_str());
1412 fmii.cch = static_cast<UINT>(ctext.size()); 1412 fmii.cch = static_cast<UINT>(ctext.size());
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
1616 1616
1617 HICON CPluginClass::GetStatusBarIcon(const CString& url) 1617 HICON CPluginClass::GetStatusBarIcon(const CString& url)
1618 { 1618 {
1619 // use the disable icon as defualt, if the client doesn't exists 1619 // use the disable icon as defualt, if the client doesn't exists
1620 HICON hIcon = GetIcon(ICON_PLUGIN_DEACTIVATED); 1620 HICON hIcon = GetIcon(ICON_PLUGIN_DEACTIVATED);
1621 1621
1622 CPluginTab* tab = GetTab(::GetCurrentThreadId()); 1622 CPluginTab* tab = GetTab(::GetCurrentThreadId());
1623 if (tab) 1623 if (tab)
1624 { 1624 {
1625 CPluginClient* client = CPluginClient::GetInstance(); 1625 CPluginClient* client = CPluginClient::GetInstance();
1626 if (client->IsWhitelistedUrl(std::wstring(url))) 1626 if (CPluginSettings::GetInstance()->IsPluginEnabled())
Oleksandr 2014/10/03 08:19:59 This should still run only if plugin is enabled. I
Eric 2014/10/07 15:57:49 Done.
1627 { 1627 {
1628 hIcon = GetIcon(ICON_PLUGIN_DISABLED); 1628 if (client->IsWhitelistedUrl(to_wstring(url)))
1629 } 1629 {
1630 else 1630 hIcon = GetIcon(ICON_PLUGIN_DISABLED);
1631 { 1631 }
1632 CPluginSettings* settings = CPluginSettings::GetInstance(); 1632 else
1633 hIcon = GetIcon(ICON_PLUGIN_ENABLED); 1633 {
1634 CPluginSettings* settings = CPluginSettings::GetInstance();
1635 hIcon = GetIcon(ICON_PLUGIN_ENABLED);
1636 }
1634 } 1637 }
1635 } 1638 }
1636 return hIcon; 1639 return hIcon;
1637 } 1640 }
1638 1641
1639 1642
1640 LRESULT CALLBACK CPluginClass::PaneWindowProc(HWND hWnd, UINT message, WPARAM wP aram, LPARAM lParam) 1643 LRESULT CALLBACK CPluginClass::PaneWindowProc(HWND hWnd, UINT message, WPARAM wP aram, LPARAM lParam)
1641 { 1644 {
1642 // Find tab 1645 // Find tab
1643 CPluginClass *pClass = FindInstance(GetParent(hWnd)); 1646 CPluginClass *pClass = FindInstance(GetParent(hWnd));
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
1964 } 1967 }
1965 } 1968 }
1966 } 1969 }
1967 1970
1968 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 1971 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
1969 } 1972 }
1970 1973
1971 return hTabWnd; 1974 return hTabWnd;
1972 1975
1973 } 1976 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld