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

Side by Side Diff: src/plugin/PluginClass.cpp

Issue 5024350814076928: Issue 1103 - Migrate Simple Adblock users
Patch Set: Added comments in code Created April 24, 2015, 11:46 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
847 return false; 847 return false;
848 } 848 }
849 } 849 }
850 850
851 int ieVersion = AdblockPlus::IE::InstalledMajorVersion(); 851 int ieVersion = AdblockPlus::IE::InstalledMajorVersion();
852 // Create status pane 852 // Create status pane
853 if (bBHO && ieVersion > 6 && !CreateStatusBarPane()) 853 if (bBHO && ieVersion > 6 && !CreateStatusBarPane())
854 { 854 {
855 return false; 855 return false;
856 } 856 }
857
858 s_criticalSectionLocal.Lock(); 857 s_criticalSectionLocal.Lock();
859 int versionCompRes = CPluginClient::GetInstance()->CompareVersions(CPluginClie nt::GetInstance()->GetPref(L"currentVersion", L"0.0"), L"1.2"); 858 std::wstring curVer = CPluginClient::GetInstance()->GetPref(std::wstring(L"cur rentVersion"), std::wstring(L"0.0"));
Eric 2015/05/17 00:29:25 Don't need explicit conversions to 'std::wstring'
859 // The plugin version can be "simpleadblock", which doesn't have the "."
860 if (curVer.find(L".") == std::wstring::npos)
861 {
862 CPluginClient::GetInstance()->SetPref(L"convertedFrom", curVer);
863 }
864 int versionCompRes = CPluginClient::GetInstance()->CompareVersions(curVer, L"1 .2");
860 865
861 bool isFirstRun = CPluginClient::GetInstance()->IsFirstRun(); 866 bool isFirstRun = CPluginClient::GetInstance()->IsFirstRun();
862 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN _VERSION)); 867 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN _VERSION));
863 // This is the first time ABP was installed 868 // This is the first time ABP was installed
864 // Or ABP was updated from the version that did not support Acceptable Ads (<1 .2) 869 // Or ABP was updated from the version that did not support Acceptable Ads (<1 .2)
865 if (isFirstRun || versionCompRes < 0) 870 if (isFirstRun || versionCompRes < 0)
866 { 871 {
867 if (!isFirstRun) 872 if (!isFirstRun)
868 { 873 {
869 CPluginClient::GetInstance()->SetPref(L"displayUpdatePage", true); 874 if (!CPluginClient::GetInstance()->GetPref(curVer, false))
Eric 2015/05/17 00:29:25 Is the value of 'curVer' the name of a preference?
875 {
876 CPluginClient::GetInstance()->SetPref(L"displayUpdatePage", true);
877 }
870 } 878 }
871 879
872 // IE6 can't be accessed from another thread, execute in current thread 880 // IE6 can't be accessed from another thread, execute in current thread
873 if (ieVersion < 7) 881 if (ieVersion < 7)
874 { 882 {
875 FirstRunThread(); 883 FirstRunThread();
876 } 884 }
877 else 885 else
878 { 886 {
879 CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThr ead, NULL, NULL, NULL); 887 CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThr ead, NULL, NULL, NULL);
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1884 } 1892 }
1885 } 1893 }
1886 } 1894 }
1887 1895
1888 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 1896 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
1889 } 1897 }
1890 1898
1891 return hTabWnd; 1899 return hTabWnd;
1892 1900
1893 } 1901 }
OLDNEW

Powered by Google App Engine
This is Rietveld