OLD | NEW |
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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 callbackWindow = 0; | 80 callbackWindow = 0; |
81 } | 81 } |
82 return; | 82 return; |
83 } | 83 } |
84 | 84 |
85 | 85 |
86 CriticalSection firstRunLock; | 86 CriticalSection firstRunLock; |
87 CriticalSection updateCheckLock; | 87 CriticalSection updateCheckLock; |
88 bool firstRunActionExecuted = false; | 88 bool firstRunActionExecuted = false; |
89 AdblockPlus::ReferrerMapping referrerMapping; | 89 AdblockPlus::ReferrerMapping referrerMapping; |
| 90 std::string convertedFrom = ""; |
90 Communication::OutputBuffer HandleRequest(Communication::InputBuffer& request) | 91 Communication::OutputBuffer HandleRequest(Communication::InputBuffer& request) |
91 { | 92 { |
92 Communication::OutputBuffer response; | 93 Communication::OutputBuffer response; |
93 | 94 |
94 Communication::ProcType procedure; | 95 Communication::ProcType procedure; |
95 request >> procedure; | 96 request >> procedure; |
96 switch (procedure) | 97 switch (procedure) |
97 { | 98 { |
98 case Communication::PROC_MATCHES: | 99 case Communication::PROC_MATCHES: |
99 { | 100 { |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 if (host.empty()) | 361 if (host.empty()) |
361 { | 362 { |
362 response << url; | 363 response << url; |
363 } | 364 } |
364 else | 365 else |
365 { | 366 { |
366 response << host; | 367 response << host; |
367 } | 368 } |
368 break; | 369 break; |
369 } | 370 } |
| 371 case Communication::PROC_GET_CONVERTED_FROM: |
| 372 { |
| 373 if (convertedFrom != "") |
| 374 { |
| 375 response << convertedFrom; |
| 376 break; |
| 377 } |
| 378 std::wstring updatedFromKeyPath = L"Software\\Adblock Plus for IE\\Conve
rtedFrom"; |
| 379 try |
| 380 { |
| 381 AdblockPlus::RegistryKey updatedFromKey(HKEY_CURRENT_USER, updatedFrom
KeyPath); |
| 382 convertedFrom = ToUtf8String(updatedFromKey.value_wstring(L"name")); |
| 383 } |
| 384 catch(std::runtime_error) |
| 385 { |
| 386 break; |
| 387 } |
| 388 LONG res = RegDeleteKey(HKEY_CURRENT_USER, updatedFromKeyPath.c_str()); |
| 389 response << convertedFrom; |
| 390 break; |
| 391 } |
370 } | 392 } |
371 return response; | 393 return response; |
372 } | 394 } |
373 | 395 |
374 void ClientThread(Communication::Pipe* pipe) | 396 void ClientThread(Communication::Pipe* pipe) |
375 { | 397 { |
376 std::stringstream stream; | 398 std::stringstream stream; |
377 stream << GetCurrentThreadId(); | 399 stream << GetCurrentThreadId(); |
378 std::string threadId = stream.str(); | 400 std::string threadId = stream.str(); |
379 std::string threadString = "(Thread ID: " + threadId + ")"; | 401 std::string threadString = "(Thread ID: " + threadId + ")"; |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 } | 543 } |
522 catch (const std::runtime_error& e) | 544 catch (const std::runtime_error& e) |
523 { | 545 { |
524 DebugException(e); | 546 DebugException(e); |
525 return 1; | 547 return 1; |
526 } | 548 } |
527 } | 549 } |
528 | 550 |
529 return 0; | 551 return 0; |
530 } | 552 } |
OLD | NEW |