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

Delta Between Two Patch Sets: Shared/PluginSettings.h

Issue 9998007: Initial libadblockplus integration (Closed)
Left Patch Set: Subscription changes and filter management cleanup Created April 5, 2013, 1:56 a.m.
Right Patch Set: Whitelisting management Created April 11, 2013, 9:06 a.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 | « Shared/PluginConfiguration.cpp ('k') | Shared/PluginSettings.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 /** 1 /**
2 * This class contains all client functionality of the IE plugin 2 * This class contains all client functionality of the IE plugin
3 * 3 *
4 * Exception errors are tested by calls to ExceptionsTest from: Main ... 4 * Exception errors are tested by calls to ExceptionsTest from: Main ...
5 */ 5 */
6 6
7 #ifndef _PLUGIN_SETTINGS_H_ 7 #ifndef _PLUGIN_SETTINGS_H_
8 #define _PLUGIN_SETTINGS_H_ 8 #define _PLUGIN_SETTINGS_H_
9 9
10 10
11 #include "PluginTypedef.h" 11 #include "PluginTypedef.h"
12 12 #include "AdblockPlus.h"
13 13
14 // Main settings 14 // Main settings
15 15
16 #define SETTING_PLUGIN_INFO_PANEL L"plugininfopanel" 16 #define SETTING_PLUGIN_INFO_PANEL L"plugininfopanel"
17 #define SETTING_PLUGIN_VERSION L"pluginversion" 17 #define SETTING_PLUGIN_VERSION L"pluginversion"
18 #define SETTING_PLUGIN_UPDATE_URL L"pluginupdateurl" 18 #define SETTING_PLUGIN_UPDATE_URL L"pluginupdateurl"
19 #define SETTING_PLUGIN_UPDATE_VERSION L"pluginupdateversion" 19 #define SETTING_PLUGIN_UPDATE_VERSION L"pluginupdateversion"
20 #define SETTING_PLUGIN_UPDATE_TIME L"pluginupdatetime" 20 #define SETTING_PLUGIN_UPDATE_TIME L"pluginupdatetime"
21 #define SETTING_PLUGIN_SELFTEST L"pluginselftest" 21 #define SETTING_PLUGIN_SELFTEST L"pluginselftest"
22 #define SETTING_LANGUAGE L"language" 22 #define SETTING_LANGUAGE L"language"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 bool m_isFirstRun; 63 bool m_isFirstRun;
64 bool m_isFirstRunUpdate; 64 bool m_isFirstRunUpdate;
65 65
66 DWORD m_dwMainProcessId; 66 DWORD m_dwMainProcessId;
67 DWORD m_dwMainThreadId; 67 DWORD m_dwMainThreadId;
68 DWORD m_dwMainUiThreadId; 68 DWORD m_dwMainUiThreadId;
69 DWORD m_dwWorkingThreadId; 69 DWORD m_dwWorkingThreadId;
70 70
71 CString m_tabNumber; 71 CString m_tabNumber;
72 72
73 #ifdef SUPPORT_WHITELIST
74 TDomainList m_domainList;
75 TDomainHistory m_domainHistory;
76 #endif
77
78 CPluginSettings::TProperties m_properties; 73 CPluginSettings::TProperties m_properties;
79 74
80 bool m_isDirty; 75 bool m_isDirty;
81 76
82 CString m_settingsVersion; 77 CString m_settingsVersion;
83 std::auto_ptr<CPluginIniFileW> m_settingsFile; 78 std::auto_ptr<CPluginIniFileW> m_settingsFile;
84 79
85 static WCHAR* s_dataPath; 80 static WCHAR* s_dataPath;
86 static WCHAR* s_dataPathParent; 81 static WCHAR* s_dataPathParent;
87 82
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 bool IsPluginUpdateAvailable() const; 132 bool IsPluginUpdateAvailable() const;
138 133
139 bool IsPluginSelftestEnabled(); 134 bool IsPluginSelftestEnabled();
140 135
141 bool FilterlistExpired(CString filterlist) const; 136 bool FilterlistExpired(CString filterlist) const;
142 bool FilterShouldLoad(CString filterlist) const; 137 bool FilterShouldLoad(CString filterlist) const;
143 bool SetFilterRefreshDate(CString filterlist, time_t refreshtime); 138 bool SetFilterRefreshDate(CString filterlist, time_t refreshtime);
144 139
145 std::map<CString, CString> GetFilterLanguageTitleList() const; 140 std::map<CString, CString> GetFilterLanguageTitleList() const;
146 141
147 #ifdef SUPPORT_WHITELIST
148
149 void AddDomainToHistory(const CString& domain);
150 TDomainHistory GetDomainHistory() const;
151
152 #endif // SUPPORT_WHITELIST
153
154 void SetMainProcessId(); 142 void SetMainProcessId();
155 void SetMainProcessId(DWORD id); 143 void SetMainProcessId(DWORD id);
156 bool IsMainProcess(DWORD dwProcessId=0) const; 144 bool IsMainProcess(DWORD dwProcessId=0) const;
157 145
158 void SetMainUiThreadId(); 146 void SetMainUiThreadId();
159 void SetMainUiThreadId(DWORD id); 147 void SetMainUiThreadId(DWORD id);
160 bool IsMainUiThread(DWORD dwThread=0) const; 148 bool IsMainUiThread(DWORD dwThread=0) const;
161 149
162 void SetMainThreadId(); 150 void SetMainThreadId();
163 void SetMainThreadId(DWORD id); 151 void SetMainThreadId(DWORD id);
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 void IncrementTabVersion(const CString& key); 208 void IncrementTabVersion(const CString& key);
221 209
222 // Settings whitelist 210 // Settings whitelist
223 #ifdef SUPPORT_WHITELIST 211 #ifdef SUPPORT_WHITELIST
224 212
225 private: 213 private:
226 214
227 bool m_isDirtyWhitelist; 215 bool m_isDirtyWhitelist;
228 DWORD m_WindowsBuildNumber; 216 DWORD m_WindowsBuildNumber;
229 217
230 TDomainList m_whitelist;
231 TDomainList m_whitelistToGo;
232
233 std::auto_ptr<CPluginIniFileW> m_settingsFileWhitelist; 218 std::auto_ptr<CPluginIniFileW> m_settingsFileWhitelist;
219 std::vector<std::string> m_whitelistedDomains;
234 220
235 void ClearWhitelist(); 221 void ClearWhitelist();
236
237 bool ReadWhitelist(bool bDebug=true); 222 bool ReadWhitelist(bool bDebug=true);
238 bool WriteWhitelist(bool bDebug=true); 223
239 224 public:
240 public: 225
241 226 void AddWhiteListedDomain(const CString& domain);
242 void AddWhiteListedDomain(const CString& domain, int reason=1, bool isToGo=fal se);
243 void RemoveWhiteListedDomainsToGo(const TDomainList& domains);
244 void ReplaceWhiteListedDomains(const TDomainList& domains);
245 bool IsWhiteListedDomain(const CString& domain) const; 227 bool IsWhiteListedDomain(const CString& domain) const;
246 int GetWhiteListedDomainCount() const; 228 int GetWhiteListedDomainCount() const;
247 TDomainList GetWhiteListedDomainList(bool isToGo=false) const; 229 std::vector<std::string> GetWhiteListedDomainList(bool isToGo=false);
248 230
249 bool MakeRequestForUpdate(); 231 bool MakeRequestForUpdate();
250 bool RefreshWhitelist(); 232 bool RefreshWhitelist();
251 DWORD GetWindowsBuildNumber(); 233 DWORD GetWindowsBuildNumber();
252 234
253 void SetSubscription(BSTR language); 235 void SetSubscription(BSTR language);
254 void SetSubscription(std::string language); 236 void SetSubscription(std::string language);
237 CString GetSubscription();
255 void RefreshFilterlist(); 238 void RefreshFilterlist();
256
257
258 #endif //SUPPORT_WHITELIST 239 #endif //SUPPORT_WHITELIST
259 240
241 std::vector<AdblockPlus::SubscriptionPtr> m_subscriptions;
260 }; 242 };
261 243
262 244
263 #endif // _PLUGIN_SETTINGS_H_ 245 #endif // _PLUGIN_SETTINGS_H_
LEFTRIGHT

Powered by Google App Engine
This is Rietveld