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: Rebase and cleanup Created July 13, 2015, 3:44 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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
699 } 699 }
700 } 700 }
701 701
702 int ieVersion = AdblockPlus::IE::InstalledMajorVersion(); 702 int ieVersion = AdblockPlus::IE::InstalledMajorVersion();
703 // Create status pane 703 // Create status pane
704 if (ieVersion > 6 && !CreateStatusBarPane()) 704 if (ieVersion > 6 && !CreateStatusBarPane())
705 { 705 {
706 return false; 706 return false;
707 } 707 }
708 s_criticalSectionLocal.Lock(); 708 s_criticalSectionLocal.Lock();
709 std::wstring curVer = CPluginClient::GetInstance()->GetPref(std::wstring(L"cur rentVersion"), std::wstring(L"0.0")); 709 std::wstring curVer = CPluginClient::GetInstance()->GetPref(L"currentVersion", L"0.0");
710 // The plugin version can be "simpleadblock", which doesn't have the "." 710 // The plugin version can be "simpleadblock", which doesn't have the "."
711 if (curVer.find(L".") == std::wstring::npos) 711 if (curVer.find(L".") == std::wstring::npos)
712 { 712 {
713 CPluginClient::GetInstance()->SetPref(L"convertedFrom", curVer); 713 CPluginClient::GetInstance()->SetPref(L"convertedFrom", curVer);
714 } 714 }
715 int versionCompRes = CPluginClient::GetInstance()->CompareVersions(curVer, L"1 .2"); 715 int versionCompRes = CPluginClient::GetInstance()->CompareVersions(curVer, L"1 .2");
716 716
717 bool isFirstRun = CPluginClient::GetInstance()->IsFirstRun(); 717 bool isFirstRun = CPluginClient::GetInstance()->IsFirstRun();
718 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN _VERSION)); 718 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN _VERSION));
719 // This is the first time ABP was installed 719 // This is the first time ABP was installed
720 // Or ABP was updated from the version that did not support Acceptable Ads (<1 .2) 720 // Or ABP was updated from the version that did not support Acceptable Ads (<1 .2)
721 if (isFirstRun || versionCompRes < 0) 721 if (isFirstRun || versionCompRes < 0)
722 { 722 {
723 if (!isFirstRun) 723 if (!isFirstRun)
724 { 724 {
725 if (!CPluginClient::GetInstance()->GetPref(curVer, false)) 725 // Display an update page only if it's not a conversion from other product
726 if (CPluginClient::GetInstance()->GetPref(L"convertedFrom", L"") == L"")
726 { 727 {
727 CPluginClient::GetInstance()->SetPref(L"displayUpdatePage", true); 728 CPluginClient::GetInstance()->SetPref(L"displayUpdatePage", true);
728 } 729 }
729 } 730 }
730 731
731 // IE6 can't be accessed from another thread, execute in current thread 732 // IE6 can't be accessed from another thread, execute in current thread
732 if (ieVersion < 7) 733 if (ieVersion < 7)
733 { 734 {
734 FirstRunThread(); 735 FirstRunThread();
735 } 736 }
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1740 s_criticalSectionLocal.Unlock(); 1741 s_criticalSectionLocal.Unlock();
1741 1742
1742 } 1743 }
1743 } 1744 }
1744 } 1745 }
1745 1746
1746 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 1747 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
1747 } 1748 }
1748 return hTabWnd; 1749 return hTabWnd;
1749 } 1750 }
OLDNEW

Powered by Google App Engine
This is Rietveld