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

Unified Diff: src/plugin/PluginClass.cpp

Issue 6025347820683264: Issue 1106 - Enable Acceptable Ads by default for new installs and updates from versions < 1.2 (Closed)
Patch Set: Created Aug. 1, 2014, 12:56 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/plugin/AdblockPlusClient.cpp ('k') | src/shared/Communication.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/plugin/PluginClass.cpp
===================================================================
--- a/src/plugin/PluginClass.cpp
+++ b/src/plugin/PluginClass.cpp
@@ -851,8 +851,15 @@
return false;
}
- if (CPluginClient::GetInstance()->IsFirstRun())
+ s_criticalSectionLocal.Lock();
+ int versionCompRes = CPluginClient::GetInstance()->CompareVersions(CPluginClient::GetInstance()->GetPref(L"currentVersion", L"0.0"), L"1.2");
+
+ // This is the first time ABP was installed
+ // Or ABP was updated from the version that did not support Acceptable Ads (<1.2)
+ if (CPluginClient::GetInstance()->IsFirstRun() || versionCompRes < 0)
{
+ CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN_VERSION));
Felix Dahlke 2014/08/01 13:07:57 I think we should also update currentVersion when
+
// IE6 can't be accessed from another thread, execute in current thread
if (ieVersion < 7)
Felix Dahlke 2014/08/01 13:07:57 Should we really run these first run actions again
{
@@ -867,7 +874,11 @@
ShowStatusBar();
}
+ // Enable acceptable ads by default
+ std::wstring aaUrl = CPluginClient::GetInstance()->GetPref(L"subscriptions_exceptionsurl", L"");
+ CPluginClient::GetInstance()->AddSubscription(aaUrl);
}
+ s_criticalSectionLocal.Unlock();
return true;
}
« no previous file with comments | « src/plugin/AdblockPlusClient.cpp ('k') | src/shared/Communication.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld