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: Discriminate first run page title for install/update Created Aug. 1, 2014, 3:08 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/plugin/PluginUserSettings.cpp » ('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,20 @@
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");
+
+ bool isFirstRun = CPluginClient::GetInstance()->IsFirstRun();
+ CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN_VERSION));
+ // This is the first time ABP was installed
+ // Or ABP was updated from the version that did not support Acceptable Ads (<1.2)
+ if (isFirstRun || versionCompRes < 0)
{
+ if (!isFirstRun)
+ {
+ CPluginClient::GetInstance()->SetPref(L"displayUpdatePage", true);
+ }
+
// IE6 can't be accessed from another thread, execute in current thread
if (ieVersion < 7)
{
@@ -862,12 +874,16 @@
{
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThread, NULL, NULL, NULL);
}
- if ((m_hPaneWnd == NULL) || (!IsStatusBarEnabled()))
+ if (((m_hPaneWnd == NULL) || !IsStatusBarEnabled()) && isFirstRun)
{
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/plugin/PluginUserSettings.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld