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: 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:
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 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 return false; 698 return false;
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
709 s_criticalSectionLocal.Lock(); 708 s_criticalSectionLocal.Lock();
710 int versionCompRes = CPluginClient::GetInstance()->CompareVersions(CPluginClie nt::GetInstance()->GetPref(L"currentVersion", L"0.0"), L"1.2"); 709 std::wstring curVer = CPluginClient::GetInstance()->GetPref(L"currentVersion", L"0.0");
710 int versionCompRes = CPluginClient::GetInstance()->CompareVersions(curVer, L"1 .2");
711 711
712 bool isFirstRun = CPluginClient::GetInstance()->IsFirstRun(); 712 bool isFirstRun = CPluginClient::GetInstance()->IsFirstRun();
713 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN _VERSION)); 713 CPluginClient::GetInstance()->SetPref(L"currentVersion", std::wstring(IEPLUGIN _VERSION));
714 // This is the first time ABP was installed 714 // This is the first time ABP was installed
715 // 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)
716 if (isFirstRun || versionCompRes < 0) 716 if (isFirstRun || versionCompRes < 0)
717 { 717 {
718 if (!isFirstRun) 718 if (!isFirstRun)
719 { 719 {
720 CPluginClient::GetInstance()->SetPref(L"displayUpdatePage", true); 720 // Display an update page only if it's not a conversion from other product
721 if (CPluginClient::GetInstance()->GetConvertedFrom() == L"")
722 {
723 CPluginClient::GetInstance()->SetPref(L"displayUpdatePage", true);
724 }
721 } 725 }
722 726
723 // 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
724 if (ieVersion < 7) 728 if (ieVersion < 7)
725 { 729 {
726 FirstRunThread(); 730 FirstRunThread();
727 } 731 }
728 else 732 else
729 { 733 {
730 CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThr ead, NULL, NULL, NULL); 734 CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)CPluginClass::FirstRunThr ead, NULL, NULL, NULL);
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1732 s_criticalSectionLocal.Unlock(); 1736 s_criticalSectionLocal.Unlock();
1733 1737
1734 } 1738 }
1735 } 1739 }
1736 } 1740 }
1737 1741
1738 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT); 1742 hTabWnd = ::GetWindow(hTabWnd, GW_HWNDNEXT);
1739 } 1743 }
1740 return hTabWnd; 1744 return hTabWnd;
1741 } 1745 }
OLDNEW

Powered by Google App Engine
This is Rietveld