OLD | NEW |
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 24 matching lines...) Expand all Loading... |
35 ATOM CPluginClass::s_atomPaneClass = NULL; | 35 ATOM CPluginClass::s_atomPaneClass = NULL; |
36 HINSTANCE CPluginClass::s_hUxtheme = NULL; | 36 HINSTANCE CPluginClass::s_hUxtheme = NULL; |
37 std::set<CPluginClass*> CPluginClass::s_instances; | 37 std::set<CPluginClass*> CPluginClass::s_instances; |
38 std::map<DWORD, CPluginClass*> CPluginClass::s_threadInstances; | 38 std::map<DWORD, CPluginClass*> CPluginClass::s_threadInstances; |
39 | 39 |
40 CComAutoCriticalSection CPluginClass::s_criticalSectionLocal; | 40 CComAutoCriticalSection CPluginClass::s_criticalSectionLocal; |
41 CComAutoCriticalSection CPluginClass::s_criticalSectionBrowser; | 41 CComAutoCriticalSection CPluginClass::s_criticalSectionBrowser; |
42 CComAutoCriticalSection CPluginClass::s_criticalSectionWindow; | 42 CComAutoCriticalSection CPluginClass::s_criticalSectionWindow; |
43 | 43 |
44 CComQIPtr<IWebBrowser2> CPluginClass::s_asyncWebBrowser2; | 44 CComQIPtr<IWebBrowser2> CPluginClass::s_asyncWebBrowser2; |
45 std::map<UINT,CString> CPluginClass::s_menuDomains; | |
46 | 45 |
47 /* | 46 /* |
48 * Without namespace declaration, the identifier "Rectangle" is ambiguous | 47 * Without namespace declaration, the identifier "Rectangle" is ambiguous |
49 * See http://msdn.microsoft.com/en-us/library/windows/desktop/dd162898(v=vs.85)
.aspx | 48 * See http://msdn.microsoft.com/en-us/library/windows/desktop/dd162898(v=vs.85)
.aspx |
50 */ | 49 */ |
51 namespace AdblockPlus | 50 namespace AdblockPlus |
52 { | 51 { |
53 /** | 52 /** |
54 * Replacement for ATL type CRect. | 53 * Replacement for ATL type CRect. |
55 */ | 54 */ |
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1375 // Invalidate and redraw the control | 1374 // Invalidate and redraw the control |
1376 UpdateStatusBar(); | 1375 UpdateStatusBar(); |
1377 } | 1376 } |
1378 | 1377 |
1379 | 1378 |
1380 bool CPluginClass::SetMenuBar(HMENU hMenu, const CString& url) | 1379 bool CPluginClass::SetMenuBar(HMENU hMenu, const CString& url) |
1381 { | 1380 { |
1382 DEBUG_GENERAL("SetMenuBar"); | 1381 DEBUG_GENERAL("SetMenuBar"); |
1383 | 1382 |
1384 std::wstring ctext; | 1383 std::wstring ctext; |
1385 | |
1386 s_criticalSectionLocal.Lock(); | |
1387 { | |
1388 s_menuDomains.clear(); | |
1389 } | |
1390 s_criticalSectionLocal.Unlock(); | |
1391 | |
1392 Dictionary* dictionary = Dictionary::GetInstance(); | 1384 Dictionary* dictionary = Dictionary::GetInstance(); |
1393 | 1385 |
1394 MENUITEMINFOW fmii; | 1386 MENUITEMINFOW fmii; |
1395 memset(&fmii, 0, sizeof(MENUITEMINFO)); | 1387 memset(&fmii, 0, sizeof(MENUITEMINFO)); |
1396 fmii.cbSize = sizeof(MENUITEMINFO); | 1388 fmii.cbSize = sizeof(MENUITEMINFO); |
1397 | 1389 |
1398 MENUITEMINFOW miiSep; | 1390 MENUITEMINFOW miiSep; |
1399 memset(&miiSep, 0, sizeof(MENUITEMINFO)); | 1391 memset(&miiSep, 0, sizeof(MENUITEMINFO)); |
1400 miiSep.cbSize = sizeof(MENUITEMINFO); | 1392 miiSep.cbSize = sizeof(MENUITEMINFO); |
1401 miiSep.fMask = MIIM_TYPE | MIIM_FTYPE; | 1393 miiSep.fMask = MIIM_TYPE | MIIM_FTYPE; |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 | 1616 |
1625 HICON CPluginClass::GetStatusBarIcon(const CString& url) | 1617 HICON CPluginClass::GetStatusBarIcon(const CString& url) |
1626 { | 1618 { |
1627 // 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 |
1628 HICON hIcon = GetIcon(ICON_PLUGIN_DEACTIVATED); | 1620 HICON hIcon = GetIcon(ICON_PLUGIN_DEACTIVATED); |
1629 | 1621 |
1630 CPluginTab* tab = GetTab(::GetCurrentThreadId()); | 1622 CPluginTab* tab = GetTab(::GetCurrentThreadId()); |
1631 if (tab) | 1623 if (tab) |
1632 { | 1624 { |
1633 CPluginClient* client = CPluginClient::GetInstance(); | 1625 CPluginClient* client = CPluginClient::GetInstance(); |
1634 if (!CPluginSettings::GetInstance()->IsPluginEnabled()) | 1626 if (CPluginSettings::GetInstance()->IsPluginEnabled()) |
1635 { | 1627 { |
1636 } | 1628 if (client->IsWhitelistedUrl(to_wstring(url))) |
1637 else if (client->IsWhitelistedUrl(to_wstring(url))) | 1629 { |
1638 { | 1630 hIcon = GetIcon(ICON_PLUGIN_DISABLED); |
1639 hIcon = GetIcon(ICON_PLUGIN_DISABLED); | 1631 } |
1640 } | 1632 else |
1641 else | 1633 { |
1642 { | 1634 CPluginSettings* settings = CPluginSettings::GetInstance(); |
1643 CPluginSettings* settings = CPluginSettings::GetInstance(); | 1635 hIcon = GetIcon(ICON_PLUGIN_ENABLED); |
1644 hIcon = GetIcon(ICON_PLUGIN_ENABLED); | 1636 } |
1645 } | 1637 } |
1646 } | 1638 } |
1647 return hIcon; | 1639 return hIcon; |
1648 } | 1640 } |
1649 | 1641 |
1650 | 1642 |
1651 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) |
1652 { | 1644 { |
1653 // Find tab | 1645 // Find tab |
1654 CPluginClass *pClass = FindInstance(GetParent(hWnd)); | 1646 CPluginClass *pClass = FindInstance(GetParent(hWnd)); |
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1975 } | 1967 } |
1976 } | 1968 } |
1977 } | 1969 } |
1978 | 1970 |
1979 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); | 1971 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); |
1980 } | 1972 } |
1981 | 1973 |
1982 return hTabWnd; | 1974 return hTabWnd; |
1983 | 1975 |
1984 } | 1976 } |
OLD | NEW |