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

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

Issue 6025347820683264: Issue 1106 - Enable Acceptable Ads by default for new installs and updates from versions < 1.2 (Closed)
Left Patch Set: Created Aug. 1, 2014, 12:56 p.m.
Right 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:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « src/plugin/AdblockPlusClient.cpp ('k') | src/plugin/PluginUserSettings.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 "PluginClass.h" 3 #include "PluginClass.h"
4 #include "PluginSettings.h" 4 #include "PluginSettings.h"
5 #include "PluginSystem.h" 5 #include "PluginSystem.h"
6 #ifdef SUPPORT_FILTER 6 #ifdef SUPPORT_FILTER
7 #include "PluginFilter.h" 7 #include "PluginFilter.h"
8 #endif 8 #endif
9 #include "PluginMimeFilterClient.h" 9 #include "PluginMimeFilterClient.h"
10 #include "PluginClient.h" 10 #include "PluginClient.h"
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 int ieVersion = CPluginClient::GetInstance()->GetIEVersion(); 847 int ieVersion = CPluginClient::GetInstance()->GetIEVersion();
848 // Create status pane 848 // Create status pane
849 if (bBHO && ieVersion > 6 && !CreateStatusBarPane()) 849 if (bBHO && ieVersion > 6 && !CreateStatusBarPane())
850 { 850 {
851 return false; 851 return false;
852 } 852 }
853 853
854 s_criticalSectionLocal.Lock(); 854 s_criticalSectionLocal.Lock();
855 int versionCompRes = CPluginClient::GetInstance()->CompareVersions(CPluginClie nt::GetInstance()->GetPref(L"currentVersion", L"0.0"), L"1.2"); 855 int versionCompRes = CPluginClient::GetInstance()->CompareVersions(CPluginClie nt::GetInstance()->GetPref(L"currentVersion", L"0.0"), L"1.2");
856 856
857 bool isFirstRun = CPluginClient::GetInstance()->IsFirstRun();
858 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN _VERSION));
857 // This is the first time ABP was installed 859 // This is the first time ABP was installed
858 // Or ABP was updated from the version that did not support Acceptable Ads (<1 .2) 860 // Or ABP was updated from the version that did not support Acceptable Ads (<1 .2)
859 if (CPluginClient::GetInstance()->IsFirstRun() || versionCompRes < 0) 861 if (isFirstRun || versionCompRes < 0)
860 { 862 {
861 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUG IN_VERSION)); 863 if (!isFirstRun)
Felix Dahlke 2014/08/01 13:07:57 I think we should also update currentVersion when
864 {
865 CPluginClient::GetInstance()->SetPref(L"displayUpdatePage", true);
866 }
862 867
863 // IE6 can't be accessed from another thread, execute in current thread 868 // IE6 can't be accessed from another thread, execute in current thread
864 if (ieVersion < 7) 869 if (ieVersion < 7)
Felix Dahlke 2014/08/01 13:07:57 Should we really run these first run actions again
865 { 870 {
866 FirstRunThread(); 871 FirstRunThread();
867 } 872 }
868 else 873 else
869 { 874 {
870 CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThr ead, NULL, NULL, NULL); 875 CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThr ead, NULL, NULL, NULL);
871 } 876 }
872 if ((m_hPaneWnd == NULL) || (!IsStatusBarEnabled())) 877 if (((m_hPaneWnd == NULL) || !IsStatusBarEnabled()) && isFirstRun)
873 { 878 {
874 ShowStatusBar(); 879 ShowStatusBar();
875 } 880 }
876 881
877 // Enable acceptable ads by default 882 // Enable acceptable ads by default
878 std::wstring aaUrl = CPluginClient::GetInstance()->GetPref(L"subscriptions_e xceptionsurl", L""); 883 std::wstring aaUrl = CPluginClient::GetInstance()->GetPref(L"subscriptions_e xceptionsurl", L"");
879 CPluginClient::GetInstance()->AddSubscription(aaUrl); 884 CPluginClient::GetInstance()->AddSubscription(aaUrl);
880 } 885 }
881 s_criticalSectionLocal.Unlock(); 886 s_criticalSectionLocal.Unlock();
882 return true; 887 return true;
(...skipping 1123 matching lines...) Expand 10 before | Expand all | Expand 10 after
2006 } 2011 }
2007 } 2012 }
2008 } 2013 }
2009 2014
2010 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 2015 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
2011 } 2016 }
2012 2017
2013 return hTabWnd; 2018 return hTabWnd;
2014 2019
2015 } 2020 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld