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

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

Issue 11043057: First run page triggering (Closed)
Left Patch Set: Created July 11, 2013, 9:49 a.m.
Right Patch Set: Minor refactoring. Renaming and a small cleanup. Created July 26, 2013, 12:05 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/PluginSettings.h ('k') | src/plugin/PluginTabBase.cpp » ('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 <Wbemidl.h> 3 #include <Wbemidl.h>
4 #include <time.h> 4 #include <time.h>
5 #include "PluginSettings.h" 5 #include "PluginSettings.h"
6 #include "PluginClient.h" 6 #include "PluginClient.h"
7 #include "PluginSystem.h" 7 #include "PluginSystem.h"
8 #ifdef SUPPORT_FILTER 8 #ifdef SUPPORT_FILTER
9 #include "PluginFilter.h" 9 #include "PluginFilter.h"
10 #endif 10 #endif
11 #include "PluginMutex.h" 11 #include "PluginMutex.h"
12 #include "../shared/Utils.h" 12 #include "../shared/Utils.h"
13 #include <memory> 13 #include <memory>
14 14
15 15
16 // IE functions 16 // IE functions
17 #pragma comment(lib, "iepmapi.lib") 17 #pragma comment(lib, "iepmapi.lib")
18 18
19 #include <knownfolders.h> 19 #include <knownfolders.h>
20 20
21 namespace 21 namespace
22 { 22 {
23 std::wstring CreateDomainWhitelistingFilter(CString domain) 23 std::wstring CreateDomainWhitelistingFilter(const CString domain)
24 { 24 {
25 return std::wstring(L"@@||" + domain + L"^$document"); 25 return std::wstring(L"@@||") + domain.GetString() + std::wstring(L"^$documen t");
26 } 26 }
27 } 27 }
28 28
29 class TSettings 29 class TSettings
30 { 30 {
31 DWORD processorId; 31 DWORD processorId;
32 32
33 char sPluginId[44]; 33 char sPluginId[44];
34 }; 34 };
35 35
(...skipping 23 matching lines...) Expand all
59 ~CPluginSettingsWhitelistLock() {} 59 ~CPluginSettingsWhitelistLock() {}
60 }; 60 };
61 61
62 #endif 62 #endif
63 63
64 CPluginSettings* CPluginSettings::s_instance = NULL; 64 CPluginSettings* CPluginSettings::s_instance = NULL;
65 65
66 CComAutoCriticalSection CPluginSettings::s_criticalSectionLocal; 66 CComAutoCriticalSection CPluginSettings::s_criticalSectionLocal;
67 67
68 68
69 CPluginSettings::CPluginSettings() : 69 CPluginSettings::CPluginSettings() : m_dwWorkingThreadId(0), m_isPluginEnabledTa b(true)
70 m_settingsVersion("1"), m_dwWorkingThreadId(0), m_isPluginEnabledTab(true)
71 { 70 {
72 s_instance = NULL; 71 s_instance = NULL;
73 72
74 m_WindowsBuildNumber = 0; 73 m_WindowsBuildNumber = 0;
75 74
76 #ifdef SUPPORT_WHITELIST 75 #ifdef SUPPORT_WHITELIST
77 ClearWhitelist(); 76 ClearWhitelist();
78 #endif 77 #endif
79 } 78 }
80 79
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 } 226 }
228 s_criticalSectionLocal.Unlock(); 227 s_criticalSectionLocal.Unlock();
229 } 228 }
230 } 229 }
231 bool CPluginSettings::GetPluginEnabled() const 230 bool CPluginSettings::GetPluginEnabled() const
232 { 231 {
233 //TODO: Query AdblockPlusEngine 232 //TODO: Query AdblockPlusEngine
234 return m_isPluginEnabledTab; 233 return m_isPluginEnabledTab;
235 } 234 }
236 235
237 bool CPluginSettings::GetStatusBarAsked()
238 {
239 std::wstring res = CPluginClient::GetInstance()->GetPref(L"statusbarasked");
240 return res == L"true";
241 }
242
243 void CPluginSettings::SetStatusBarAsked()
244 {
245 CPluginClient::GetInstance()->SetPref(L"statusbarasked", L"true");
246 }
247
248 236
249 void CPluginSettings::AddError(const CString& error, const CString& errorCode) 237 void CPluginSettings::AddError(const CString& error, const CString& errorCode)
250 { 238 {
251 DEBUG_SETTINGS(L"SettingsTab::AddError error:" + error + " code:" + errorCode) 239 DEBUG_SETTINGS(L"SettingsTab::AddError error:" + error + " code:" + errorCode)
252 } 240 }
253 241
254 242
255 // ============================================================================ 243 // ============================================================================
256 // Whitelist settings 244 // Whitelist settings
257 // ============================================================================ 245 // ============================================================================
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 std::vector<SubscriptionDescription> subscriptions = CPluginClient::GetInstanc e()->GetListedSubscriptions(); 360 std::vector<SubscriptionDescription> subscriptions = CPluginClient::GetInstanc e()->GetListedSubscriptions();
373 if (subscriptions.size() > 0) 361 if (subscriptions.size() > 0)
374 return CString(subscriptions.front().url.c_str()); 362 return CString(subscriptions.front().url.c_str());
375 else 363 else
376 return CString(L""); 364 return CString(L"");
377 } 365 }
378 366
379 367
380 368
381 #endif // SUPPORT_WHITELIST 369 #endif // SUPPORT_WHITELIST
LEFTRIGHT

Powered by Google App Engine
This is Rietveld