OLD | NEW |
1 #include <AdblockPlus.h> | 1 #include <AdblockPlus.h> |
2 #include <functional> | 2 #include <functional> |
3 #include <vector> | 3 #include <vector> |
4 #include <Windows.h> | 4 #include <Windows.h> |
5 | 5 |
6 #include "../shared/AutoHandle.h" | 6 #include "../shared/AutoHandle.h" |
7 #include "../shared/Communication.h" | 7 #include "../shared/Communication.h" |
8 #include "../shared/Dictionary.h" | 8 #include "../shared/Dictionary.h" |
9 #include "../shared/Utils.h" | 9 #include "../shared/Utils.h" |
10 #include "../shared/Version.h" | 10 #include "../shared/Version.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 { | 307 { |
308 response << ToUtf16String(filterEngine->GetPref("documentation_link")->A
sString()); | 308 response << ToUtf16String(filterEngine->GetPref("documentation_link")->A
sString()); |
309 break; | 309 break; |
310 } | 310 } |
311 case Communication::PROC_TOGGLE_PLUGIN_ENABLED: | 311 case Communication::PROC_TOGGLE_PLUGIN_ENABLED: |
312 { | 312 { |
313 filterEngine->SetPref("enabled", filterEngine->GetJsEngine()->NewValue(!
filterEngine->GetPref("enabled")->AsBool())); | 313 filterEngine->SetPref("enabled", filterEngine->GetJsEngine()->NewValue(!
filterEngine->GetPref("enabled")->AsBool())); |
314 response << filterEngine->GetPref("enabled")->AsBool(); | 314 response << filterEngine->GetPref("enabled")->AsBool(); |
315 break; | 315 break; |
316 } | 316 } |
| 317 case Communication::PROC_GET_HOST: |
| 318 { |
| 319 std::string url; |
| 320 request >> url; |
| 321 std::string host = filterEngine->GetHostFromURL(url); |
| 322 if (host.empty()) |
| 323 { |
| 324 response << url; |
| 325 } |
| 326 else |
| 327 { |
| 328 response << host; |
| 329 } |
| 330 break; |
| 331 } |
317 } | 332 } |
318 return response; | 333 return response; |
319 } | 334 } |
320 | 335 |
321 DWORD WINAPI ClientThread(LPVOID param) | 336 DWORD WINAPI ClientThread(LPVOID param) |
322 { | 337 { |
323 std::auto_ptr<Communication::Pipe> pipe(static_cast<Communication::Pipe*>(pa
ram)); | 338 std::auto_ptr<Communication::Pipe> pipe(static_cast<Communication::Pipe*>(pa
ram)); |
324 | 339 |
325 std::stringstream stream; | 340 std::stringstream stream; |
326 stream << GetCurrentThreadId(); | 341 stream << GetCurrentThreadId(); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 } | 463 } |
449 catch (std::runtime_error e) | 464 catch (std::runtime_error e) |
450 { | 465 { |
451 DebugException(e); | 466 DebugException(e); |
452 return 1; | 467 return 1; |
453 } | 468 } |
454 } | 469 } |
455 | 470 |
456 return 0; | 471 return 0; |
457 } | 472 } |
OLD | NEW |