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

Side by Side 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.
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/AdblockPlusClient.cpp ('k') | src/plugin/PluginUserSettings.cpp » ('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 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 833 matching lines...) Expand 10 before | Expand all | Expand 10 after
844 } 844 }
845 845
846 846
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 if (CPluginClient::GetInstance()->IsFirstRun()) 854 s_criticalSectionLocal.Lock();
855 int versionCompRes = CPluginClient::GetInstance()->CompareVersions(CPluginClie nt::GetInstance()->GetPref(L"currentVersion", L"0.0"), L"1.2");
856
857 bool isFirstRun = CPluginClient::GetInstance()->IsFirstRun();
858 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN _VERSION));
859 // This is the first time ABP was installed
860 // Or ABP was updated from the version that did not support Acceptable Ads (<1 .2)
861 if (isFirstRun || versionCompRes < 0)
855 { 862 {
863 if (!isFirstRun)
864 {
865 CPluginClient::GetInstance()->SetPref(L"displayUpdatePage", true);
866 }
867
856 // 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
857 if (ieVersion < 7) 869 if (ieVersion < 7)
858 { 870 {
859 FirstRunThread(); 871 FirstRunThread();
860 } 872 }
861 else 873 else
862 { 874 {
863 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);
864 } 876 }
865 if ((m_hPaneWnd == NULL) || (!IsStatusBarEnabled())) 877 if (((m_hPaneWnd == NULL) || !IsStatusBarEnabled()) && isFirstRun)
866 { 878 {
867 ShowStatusBar(); 879 ShowStatusBar();
868 } 880 }
869 881
882 // Enable acceptable ads by default
883 std::wstring aaUrl = CPluginClient::GetInstance()->GetPref(L"subscriptions_e xceptionsurl", L"");
884 CPluginClient::GetInstance()->AddSubscription(aaUrl);
870 } 885 }
886 s_criticalSectionLocal.Unlock();
871 return true; 887 return true;
872 } 888 }
873 889
874 bool CPluginClass::CreateStatusBarPane() 890 bool CPluginClass::CreateStatusBarPane()
875 { 891 {
876 CriticalSection::Lock lock(m_csStatusBar); 892 CriticalSection::Lock lock(m_csStatusBar);
877 893
878 CPluginClient* client = CPluginClient::GetInstance(); 894 CPluginClient* client = CPluginClient::GetInstance();
879 895
880 TCHAR szClassName[MAX_PATH]; 896 TCHAR szClassName[MAX_PATH];
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 } 2011 }
1996 } 2012 }
1997 } 2013 }
1998 2014
1999 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 2015 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
2000 } 2016 }
2001 2017
2002 return hTabWnd; 2018 return hTabWnd;
2003 2019
2004 } 2020 }
OLDNEW
« 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