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

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

Issue 6025347820683264: Issue 1106 - Enable Acceptable Ads by default for new installs and updates from versions < 1.2 (Closed)
Patch Set: Discriminate first run page title for install/update Created Aug. 1, 2014, 3:08 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/PluginClass.cpp ('k') | src/shared/Communication.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 #include "PluginUserSettings.h" 2 #include "PluginUserSettings.h"
3 #include <algorithm> 3 #include <algorithm>
4 #include "PluginSettings.h" 4 #include "PluginSettings.h"
5 #include "PluginClient.h" 5 #include "PluginClient.h"
6 #include "../shared/Dictionary.h" 6 #include "../shared/Dictionary.h"
7 7
8 static const CString s_GetMessage = L"GetMessage"; 8 static const CString s_GetMessage = L"GetMessage";
9 static const CString s_GetLanguageCount = L"GetLanguageCount"; 9 static const CString s_GetLanguageCount = L"GetLanguageCount";
10 static const CString s_GetLanguageByIndex = L"GetLanguageByIndex"; 10 static const CString s_GetLanguageByIndex = L"GetLanguageByIndex";
11 static const CString s_GetLanguageTitleByIndex = L"GetLanguageTitleByIndex"; 11 static const CString s_GetLanguageTitleByIndex = L"GetLanguageTitleByIndex";
12 static const CString s_SetLanguage = L"SetLanguage"; 12 static const CString s_SetLanguage = L"SetLanguage";
13 static const CString s_GetLanguage = L"GetLanguage"; 13 static const CString s_GetLanguage = L"GetLanguage";
14 static const CString s_GetWhitelistDomains = L"GetWhitelistDomains"; 14 static const CString s_GetWhitelistDomains = L"GetWhitelistDomains";
15 static const CString s_AddWhitelistDomain = L"AddWhitelistDomain"; 15 static const CString s_AddWhitelistDomain = L"AddWhitelistDomain";
16 static const CString s_RemoveWhitelistDomain = L"RemoveWhitelistDomain"; 16 static const CString s_RemoveWhitelistDomain = L"RemoveWhitelistDomain";
17 static const CString s_GetAppLocale = L"GetAppLocale"; 17 static const CString s_GetAppLocale = L"GetAppLocale";
18 static const CString s_GetDocumentationLink = L"GetDocumentationLink"; 18 static const CString s_GetDocumentationLink = L"GetDocumentationLink";
19 static const CString s_IsAcceptableAdsEnabled = L"IsAcceptableAdsEnabled"; 19 static const CString s_IsAcceptableAdsEnabled = L"IsAcceptableAdsEnabled";
20 static const CString s_SetAcceptableAdsEnabled = L"SetAcceptableAdsEnabled"; 20 static const CString s_SetAcceptableAdsEnabled = L"SetAcceptableAdsEnabled";
21 static const CString s_Methods[] = {s_GetMessage, s_GetLanguageCount, s_GetLangu ageByIndex, s_GetLanguageTitleByIndex, s_SetLanguage, s_GetLanguage, s_GetWhitel istDomains, s_AddWhitelistDomain, s_RemoveWhitelistDomain, s_GetAppLocale, s_Get DocumentationLink, s_IsAcceptableAdsEnabled, s_SetAcceptableAdsEnabled}; 21 static const CString s_IsUpdate = L"IsUpdate";
22 static const CString s_Methods[] = {s_GetMessage, s_GetLanguageCount, s_GetLangu ageByIndex, s_GetLanguageTitleByIndex, s_SetLanguage, s_GetLanguage, s_GetWhitel istDomains, s_AddWhitelistDomain, s_RemoveWhitelistDomain, s_GetAppLocale, s_Get DocumentationLink, s_IsAcceptableAdsEnabled, s_SetAcceptableAdsEnabled, s_IsUpda te};
22 23
23 CPluginUserSettings::CPluginUserSettings() 24 CPluginUserSettings::CPluginUserSettings()
24 { 25 {
25 } 26 }
26 27
27 28
28 STDMETHODIMP CPluginUserSettings::QueryInterface(REFIID riid, void **ppvObj) 29 STDMETHODIMP CPluginUserSettings::QueryInterface(REFIID riid, void **ppvObj)
29 { 30 {
30 if (IID_IUnknown == riid || IID_IDispatch == riid) 31 if (IID_IUnknown == riid || IID_IDispatch == riid)
31 { 32 {
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after
346 { 347 {
347 CPluginClient* client = CPluginClient::GetInstance(); 348 CPluginClient* client = CPluginClient::GetInstance();
348 client->AddSubscription(client->GetPref(L"subscriptions_exceptionsurl", L" ")); 349 client->AddSubscription(client->GetPref(L"subscriptions_exceptionsurl", L" "));
349 } 350 }
350 else 351 else
351 { 352 {
352 CPluginClient* client = CPluginClient::GetInstance(); 353 CPluginClient* client = CPluginClient::GetInstance();
353 client->RemoveSubscription(client->GetPref(L"subscriptions_exceptionsurl", L"")); 354 client->RemoveSubscription(client->GetPref(L"subscriptions_exceptionsurl", L""));
354 } 355 }
355 } 356 }
357 else if (s_IsUpdate == method)
358 {
359 if (0 != pDispparams->cArgs)
360 return DISP_E_BADPARAMCOUNT;
361
362 pVarResult->vt = VT_BOOL;
363 pVarResult->boolVal = CPluginClient::GetInstance()->GetPref(L"displayUpdateP age", false);
364 }
356 else 365 else
357 return DISP_E_MEMBERNOTFOUND; 366 return DISP_E_MEMBERNOTFOUND;
358 367
359 return S_OK; 368 return S_OK;
360 } 369 }
361 370
OLDNEW
« no previous file with comments | « src/plugin/PluginClass.cpp ('k') | src/shared/Communication.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld