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

Delta Between Two Patch Sets: src/plugin/PluginClass.cpp

Issue 5024350814076928: Issue 1103 - Migrate Simple Adblock users
Left Patch Set: Rebased Created July 28, 2015, 9:55 a.m.
Right Patch Set: Use registry instead of prefs for storing the Simple Adblock mark Created Aug. 7, 2015, 10:34 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(L"currentVersion", 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 "."
711 if (curVer.find(L".") == std::wstring::npos)
712 {
713 CPluginClient::GetInstance()->SetPref(L"convertedFrom", curVer);
714 }
715 int versionCompRes = CPluginClient::GetInstance()->CompareVersions(curVer, L"1 .2"); 710 int versionCompRes = CPluginClient::GetInstance()->CompareVersions(curVer, L"1 .2");
716 711
717 bool isFirstRun = CPluginClient::GetInstance()->IsFirstRun(); 712 bool isFirstRun = CPluginClient::GetInstance()->IsFirstRun();
718 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN _VERSION)); 713 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN _VERSION));
719 // This is the first time ABP was installed 714 // This is the first time ABP was installed
720 // Or ABP was updated from the version that did not support Acceptable Ads (<1 .2) 715 // Or ABP was updated from the version that did not support Acceptable Ads (<1 .2)
721 if (isFirstRun || versionCompRes < 0) 716 if (isFirstRun || versionCompRes < 0)
722 { 717 {
723 if (!isFirstRun) 718 if (!isFirstRun)
724 { 719 {
725 // Display an update page only if it's not a conversion from other product 720 // Display an update page only if it's not a conversion from other product
726 if (CPluginClient::GetInstance()->GetPref(L"convertedFrom", L"") == L"") 721 if (CPluginClient::GetInstance()->GetConvertedFrom() == L"")
727 { 722 {
728 CPluginClient::GetInstance()->SetPref(L"displayUpdatePage", true); 723 CPluginClient::GetInstance()->SetPref(L"displayUpdatePage", true);
729 } 724 }
730 } 725 }
731 726
732 // IE6 can't be accessed from another thread, execute in current thread 727 // IE6 can't be accessed from another thread, execute in current thread
733 if (ieVersion < 7) 728 if (ieVersion < 7)
734 { 729 {
735 FirstRunThread(); 730 FirstRunThread();
736 } 731 }
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after
1741 s_criticalSectionLocal.Unlock(); 1736 s_criticalSectionLocal.Unlock();
1742 1737
1743 } 1738 }
1744 } 1739 }
1745 } 1740 }
1746 1741
1747 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 1742 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
1748 } 1743 }
1749 return hTabWnd; 1744 return hTabWnd;
1750 } 1745 }
LEFTRIGHT

Powered by Google App Engine
This is Rietveld