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: Created Aug. 1, 2014, 12:56 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/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 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 // This is the first time ABP was installed
858 // Or ABP was updated from the version that did not support Acceptable Ads (<1 .2)
859 if (CPluginClient::GetInstance()->IsFirstRun() || versionCompRes < 0)
855 { 860 {
861 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUG IN_VERSION));
Felix Dahlke 2014/08/01 13:07:57 I think we should also update currentVersion when
862
856 // IE6 can't be accessed from another thread, execute in current thread 863 // IE6 can't be accessed from another thread, execute in current thread
857 if (ieVersion < 7) 864 if (ieVersion < 7)
Felix Dahlke 2014/08/01 13:07:57 Should we really run these first run actions again
858 { 865 {
859 FirstRunThread(); 866 FirstRunThread();
860 } 867 }
861 else 868 else
862 { 869 {
863 CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThr ead, NULL, NULL, NULL); 870 CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThr ead, NULL, NULL, NULL);
864 } 871 }
865 if ((m_hPaneWnd == NULL) || (!IsStatusBarEnabled())) 872 if ((m_hPaneWnd == NULL) || (!IsStatusBarEnabled()))
866 { 873 {
867 ShowStatusBar(); 874 ShowStatusBar();
868 } 875 }
869 876
877 // Enable acceptable ads by default
878 std::wstring aaUrl = CPluginClient::GetInstance()->GetPref(L"subscriptions_e xceptionsurl", L"");
879 CPluginClient::GetInstance()->AddSubscription(aaUrl);
870 } 880 }
881 s_criticalSectionLocal.Unlock();
871 return true; 882 return true;
872 } 883 }
873 884
874 bool CPluginClass::CreateStatusBarPane() 885 bool CPluginClass::CreateStatusBarPane()
875 { 886 {
876 CriticalSection::Lock lock(m_csStatusBar); 887 CriticalSection::Lock lock(m_csStatusBar);
877 888
878 CPluginClient* client = CPluginClient::GetInstance(); 889 CPluginClient* client = CPluginClient::GetInstance();
879 890
880 TCHAR szClassName[MAX_PATH]; 891 TCHAR szClassName[MAX_PATH];
(...skipping 1114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1995 } 2006 }
1996 } 2007 }
1997 } 2008 }
1998 2009
1999 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 2010 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
2000 } 2011 }
2001 2012
2002 return hTabWnd; 2013 return hTabWnd;
2003 2014
2004 } 2015 }
OLDNEW
« 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