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

Unified Diff: src/engine/Main.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.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « locales/en.ini ('k') | src/plugin/AdblockPlusClient.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/engine/Main.cpp
===================================================================
--- a/src/engine/Main.cpp
+++ b/src/engine/Main.cpp
@@ -87,6 +87,7 @@
CriticalSection updateCheckLock;
bool firstRunActionExecuted = false;
AdblockPlus::ReferrerMapping referrerMapping;
+ std::string convertedFrom = "";
Communication::OutputBuffer HandleRequest(Communication::InputBuffer& request)
{
Communication::OutputBuffer response;
@@ -367,6 +368,27 @@
}
break;
}
+ case Communication::PROC_GET_CONVERTED_FROM:
+ {
+ if (convertedFrom != "")
+ {
+ response << convertedFrom;
+ break;
+ }
+ std::wstring updatedFromKeyPath = L"Software\\Adblock Plus for IE\\ConvertedFrom";
+ try
+ {
+ AdblockPlus::RegistryKey updatedFromKey(HKEY_CURRENT_USER, updatedFromKeyPath);
+ convertedFrom = ToUtf8String(updatedFromKey.value_wstring(L"name"));
+ }
+ catch(std::runtime_error)
+ {
+ break;
+ }
+ LONG res = RegDeleteKey(HKEY_CURRENT_USER, updatedFromKeyPath.c_str());
Eric 2015/08/10 17:08:49 Deleting the key immediately after returning its s
+ response << convertedFrom;
+ break;
+ }
}
return response;
}
« no previous file with comments | « locales/en.ini ('k') | src/plugin/AdblockPlusClient.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld