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

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

Issue 11292028: Status bar menu added (Closed)
Patch Set: Comments addressed Created Aug. 5, 2013, 1:13 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/PluginSettings.cpp ('k') | src/plugin/PluginUtil.h » ('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 "PluginClient.h" 3 #include "PluginClient.h"
4 #include "PluginSettings.h" 4 #include "PluginSettings.h"
5 #ifdef SUPPORT_CONFIG 5 #ifdef SUPPORT_CONFIG
6 #include "PluginConfig.h" 6 #include "PluginConfig.h"
7 #endif 7 #endif
8 #include "PluginTab.h" 8 #include "PluginTab.h"
9 #include "PluginDomTraverser.h" 9 #include "PluginDomTraverser.h"
10 #include "PluginClass.h" 10 #include "PluginClass.h"
11 11
12 #include "PluginTabBase.h" 12 #include "PluginTabBase.h"
13 #include "PluginUtil.h" 13 #include "PluginUtil.h"
14 #include <dispex.h> 14 #include <dispex.h>
15 15
16 int CPluginTabBase::s_dictionaryVersion = 0; 16 int CPluginTabBase::s_dictionaryVersion = 0;
17 int CPluginTabBase::s_settingsVersion = 1; 17 int CPluginTabBase::s_settingsVersion = 1;
18 #ifdef SUPPORT_FILTER 18 #ifdef SUPPORT_FILTER
19 int CPluginTabBase::s_filterVersion = 0; 19 int CPluginTabBase::s_filterVersion = 0;
20 #endif 20 #endif
21 #ifdef SUPPORT_WHITELIST 21 #ifdef SUPPORT_WHITELIST
22 int CPluginTabBase::s_whitelistVersion = 0; 22 int CPluginTabBase::s_whitelistVersion = 0;
23 #endif 23 #endif
24 #ifdef SUPPORT_CONFIG 24 #ifdef SUPPORT_CONFIG
25 int CPluginTabBase::s_configVersion = 0; 25 int CPluginTabBase::s_configVersion = 0;
26 #endif 26 #endif
27 27
28 namespace
29 {
30 CString ExtractDomain(const CString& url)
31 {
32 int pos = 0;
33 if (url.Find('/', pos) >= 0)
34 url.Tokenize(L"/", pos);
35 CString domain = url.Tokenize(L"/", pos);
36 domain.MakeLower();
37 return domain;
38 }
39 }
40 28
41 CPluginTabBase::CPluginTabBase(CPluginClass* plugin) : m_plugin(plugin), m_isAct ivated(false) 29 CPluginTabBase::CPluginTabBase(CPluginClass* plugin) : m_plugin(plugin), m_isAct ivated(false)
42 { 30 {
43 m_filter = std::auto_ptr<CPluginFilter>(new CPluginFilter()); 31 m_filter = std::auto_ptr<CPluginFilter>(new CPluginFilter());
44 32
45 CPluginClient* client = CPluginClient::GetInstance(); 33 CPluginClient* client = CPluginClient::GetInstance();
46 if (client->GetIEVersion() < 10) 34 if (client->GetIEVersion() < 10)
47 { 35 {
48 m_isActivated = true; 36 m_isActivated = true;
49 } 37 }
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 m_filter->LoadHideFilters(CPluginClient::GetInstance()->GetElementHidingSelect ors(domainString)); 96 m_filter->LoadHideFilters(CPluginClient::GetInstance()->GetElementHidingSelect ors(domainString));
109 97
110 #ifdef SUPPORT_DOM_TRAVERSER 98 #ifdef SUPPORT_DOM_TRAVERSER
111 m_traverser->ClearCache(); 99 m_traverser->ClearCache();
112 #endif 100 #endif
113 } 101 }
114 102
115 void CPluginTabBase::OnDownloadComplete(IWebBrowser2* browser) 103 void CPluginTabBase::OnDownloadComplete(IWebBrowser2* browser)
116 { 104 {
117 #ifdef SUPPORT_DOM_TRAVERSER 105 #ifdef SUPPORT_DOM_TRAVERSER
118 m_traverser->TraverseDocument(browser, GetDocumentDomain(), GetDocumentUrl()); 106 if (!CPluginClient::GetInstance()->IsWhitelistedUrl(std::wstring(GetDocumentUr l())))
107 {
108 m_traverser->TraverseDocument(browser, GetDocumentDomain(), GetDocumentUrl() );
109 }
119 #endif // SUPPORT_DOM_TRAVERSER 110 #endif // SUPPORT_DOM_TRAVERSER
120 } 111 }
121 112
122 113
123 void CPluginTabBase::OnDocumentComplete(IWebBrowser2* browser, const CString& ur l, bool isDocumentBrowser) 114 void CPluginTabBase::OnDocumentComplete(IWebBrowser2* browser, const CString& ur l, bool isDocumentBrowser)
124 { 115 {
125 CString documentUrl = GetDocumentUrl(); 116 CString documentUrl = GetDocumentUrl();
126 117
127 if (isDocumentBrowser) 118 if (isDocumentBrowser)
128 { 119 {
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 350
360 // Non-hanging sleep 351 // Non-hanging sleep
361 Sleep(50); 352 Sleep(50);
362 } 353 }
363 354
364 tabLoopIteration++; 355 tabLoopIteration++;
365 } 356 }
366 357
367 return 0; 358 return 0;
368 } 359 }
OLDNEW
« no previous file with comments | « src/plugin/PluginSettings.cpp ('k') | src/plugin/PluginUtil.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld