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: Make it less Simple Adblock specific, and add the FRP changes Created April 16, 2015, 9:52 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"));
sergei 2015/04/22 10:37:09 How does "0.0" affect `versionCompRes`? I'm not th
Oleksandr 2015/04/24 11:50:32 I don't think we should default to current version
859 if (curVer.find(L".") == std::wstring::npos)
sergei 2015/04/22 10:37:09 I would live a comment here about "simpleadblock"
860 {
861 CPluginClient::GetInstance()->SetPref(L"convertedFrom", curVer);
862 }
863 int versionCompRes = CPluginClient::GetInstance()->CompareVersions(curVer, L"1 .2");
860 864
861 bool isFirstRun = CPluginClient::GetInstance()->IsFirstRun(); 865 bool isFirstRun = CPluginClient::GetInstance()->IsFirstRun();
862 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN _VERSION)); 866 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN _VERSION));
863 // This is the first time ABP was installed 867 // This is the first time ABP was installed
864 // Or ABP was updated from the version that did not support Acceptable Ads (<1 .2) 868 // Or ABP was updated from the version that did not support Acceptable Ads (<1 .2)
865 if (isFirstRun || versionCompRes < 0) 869 if (isFirstRun || versionCompRes < 0)
866 { 870 {
867 if (!isFirstRun) 871 if (!isFirstRun)
868 { 872 {
869 CPluginClient::GetInstance()->SetPref(L"displayUpdatePage", true); 873 if (!CPluginClient::GetInstance()->GetPref(curVer, false))
874 {
875 CPluginClient::GetInstance()->SetPref(L"displayUpdatePage", true);
876 }
870 } 877 }
871 878
872 // IE6 can't be accessed from another thread, execute in current thread 879 // IE6 can't be accessed from another thread, execute in current thread
873 if (ieVersion < 7) 880 if (ieVersion < 7)
874 { 881 {
875 FirstRunThread(); 882 FirstRunThread();
876 } 883 }
877 else 884 else
878 { 885 {
879 CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThr ead, NULL, NULL, NULL); 886 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 } 1891 }
1885 } 1892 }
1886 } 1893 }
1887 1894
1888 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 1895 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
1889 } 1896 }
1890 1897
1891 return hTabWnd; 1898 return hTabWnd;
1892 1899
1893 } 1900 }
OLDNEW

Powered by Google App Engine
This is Rietveld