OLD | NEW |
1 #include <AdblockPlus.h> | 1 #include <AdblockPlus.h> |
2 #include <functional> | 2 #include <functional> |
3 #include <vector> | 3 #include <vector> |
4 #include <thread> | 4 #include <thread> |
5 #include <Windows.h> | 5 #include <Windows.h> |
6 | 6 |
7 #include "../shared/AutoHandle.h" | 7 #include "../shared/AutoHandle.h" |
8 #include "../shared/Communication.h" | 8 #include "../shared/Communication.h" |
9 #include "../shared/Dictionary.h" | 9 #include "../shared/Dictionary.h" |
10 #include "../shared/Utils.h" | 10 #include "../shared/Utils.h" |
11 #include "../shared/Version.h" | 11 #include "../shared/Version.h" |
12 #include "../shared/CriticalSection.h" | 12 #include "../shared/CriticalSection.h" |
| 13 #include "../shared/IE_version.h" |
13 #include "AdblockPlus.h" | 14 #include "AdblockPlus.h" |
14 #include "Debug.h" | 15 #include "Debug.h" |
15 #include "Updater.h" | 16 #include "Updater.h" |
16 | 17 |
17 namespace | 18 namespace |
18 { | 19 { |
19 std::auto_ptr<AdblockPlus::FilterEngine> filterEngine; | 20 std::auto_ptr<AdblockPlus::FilterEngine> filterEngine; |
20 std::auto_ptr<Updater> updater; | 21 std::auto_ptr<Updater> updater; |
21 int activeConnections = 0; | 22 int activeConnections = 0; |
22 CriticalSection activeConnectionsLock; | 23 CriticalSection activeConnectionsLock; |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 std::auto_ptr<AdblockPlus::FilterEngine> CreateFilterEngine(const std::wstring&
locale) | 416 std::auto_ptr<AdblockPlus::FilterEngine> CreateFilterEngine(const std::wstring&
locale) |
416 { | 417 { |
417 AdblockPlus::AppInfo appInfo; | 418 AdblockPlus::AppInfo appInfo; |
418 appInfo.version = ToUtf8String(IEPLUGIN_VERSION); | 419 appInfo.version = ToUtf8String(IEPLUGIN_VERSION); |
419 appInfo.name = "adblockplusie"; | 420 appInfo.name = "adblockplusie"; |
420 #ifdef _WIN64 | 421 #ifdef _WIN64 |
421 appInfo.application = "msie64"; | 422 appInfo.application = "msie64"; |
422 #else | 423 #else |
423 appInfo.application = "msie32"; | 424 appInfo.application = "msie32"; |
424 #endif | 425 #endif |
425 // TODO: Set applicationVersion parameter | 426 appInfo.applicationVersion = ToUtf8String(AdblockPlus::IE::InstalledVersionStr
ing()); |
426 appInfo.locale = ToUtf8String(locale); | 427 appInfo.locale = ToUtf8String(locale); |
427 #ifdef ADBLOCK_PLUS_TEST_MODE | 428 #ifdef ADBLOCK_PLUS_TEST_MODE |
428 appInfo.developmentBuild = true; | 429 appInfo.developmentBuild = true; |
429 #else | 430 #else |
430 appInfo.developmentBuild = false; | 431 appInfo.developmentBuild = false; |
431 #endif | 432 #endif |
432 | 433 |
433 AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::New(appInfo); | 434 AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::New(appInfo); |
434 jsEngine->SetEventCallback("updateAvailable", &OnUpdateAvailable); | 435 jsEngine->SetEventCallback("updateAvailable", &OnUpdateAvailable); |
435 | 436 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 } | 485 } |
485 catch (const std::runtime_error& e) | 486 catch (const std::runtime_error& e) |
486 { | 487 { |
487 DebugException(e); | 488 DebugException(e); |
488 return 1; | 489 return 1; |
489 } | 490 } |
490 } | 491 } |
491 | 492 |
492 return 0; | 493 return 0; |
493 } | 494 } |
OLD | NEW |