| 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 24 matching lines...) Expand all Loading... |
| 35 response << count; | 35 response << count; |
| 36 for (int32_t i = 0; i < count; i++) | 36 for (int32_t i = 0; i < count; i++) |
| 37 { | 37 { |
| 38 AdblockPlus::SubscriptionPtr subscription = subscriptions[i]; | 38 AdblockPlus::SubscriptionPtr subscription = subscriptions[i]; |
| 39 response << subscription->GetProperty("url")->AsString() | 39 response << subscription->GetProperty("url")->AsString() |
| 40 << subscription->GetProperty("title")->AsString() | 40 << subscription->GetProperty("title")->AsString() |
| 41 << subscription->GetProperty("specialization")->AsString() | 41 << subscription->GetProperty("specialization")->AsString() |
| 42 << subscription->IsListed(); | 42 << subscription->IsListed(); |
| 43 } | 43 } |
| 44 } | 44 } |
| 45 | 45 |
| 46 bool updateAvailable; | 46 bool updateAvailable; |
| 47 void UpdateCallback(const std::string res) | 47 void UpdateCallback(const std::string res) |
| 48 { | 48 { |
| 49 if (updateAvailable) | 49 if (updateAvailable) |
| 50 return; | 50 return; |
| 51 Dictionary* dictionary = Dictionary::GetInstance(); | 51 Dictionary* dictionary = Dictionary::GetInstance(); |
| 52 if (res.length() == 0) | 52 if (res.length() == 0) |
| 53 { | 53 { |
| 54 std::wstring upToDateText = dictionary->Lookup("updater", "update-already-
up-to-date-text"); | 54 std::wstring upToDateText = dictionary->Lookup("updater", "update-already-
up-to-date-text"); |
| 55 std::wstring upToDateTitle = dictionary->Lookup("updater", "update-already
-up-to-date-title"); | 55 std::wstring upToDateTitle = dictionary->Lookup("updater", "update-already
-up-to-date-title"); |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 updater->Update(); | 334 updater->Update(); |
| 335 } | 335 } |
| 336 } | 336 } |
| 337 | 337 |
| 338 std::auto_ptr<AdblockPlus::FilterEngine> CreateFilterEngine(const std::wstring&
locale) | 338 std::auto_ptr<AdblockPlus::FilterEngine> CreateFilterEngine(const std::wstring&
locale) |
| 339 { | 339 { |
| 340 AdblockPlus::AppInfo appInfo; | 340 AdblockPlus::AppInfo appInfo; |
| 341 appInfo.version = ToUtf8String(IEPLUGIN_VERSION); | 341 appInfo.version = ToUtf8String(IEPLUGIN_VERSION); |
| 342 appInfo.name = "adblockplusie"; | 342 appInfo.name = "adblockplusie"; |
| 343 #ifdef _WIN64 | 343 #ifdef _WIN64 |
| 344 appInfo.platform = "msie64"; | 344 appInfo.application = "msie64"; |
| 345 #else | 345 #else |
| 346 appInfo.platform = "msie32"; | 346 appInfo.application = "msie32"; |
| 347 #endif | 347 #endif |
| 348 // TODO: Set applicationVersion parameter |
| 348 appInfo.locale = ToUtf8String(locale); | 349 appInfo.locale = ToUtf8String(locale); |
| 349 #ifdef ADBLOCK_PLUS_TEST_MODE | 350 #ifdef ADBLOCK_PLUS_TEST_MODE |
| 350 appInfo.developmentBuild = true; | 351 appInfo.developmentBuild = true; |
| 351 #else | 352 #else |
| 352 appInfo.developmentBuild = false; | 353 appInfo.developmentBuild = false; |
| 353 #endif | 354 #endif |
| 354 | 355 |
| 355 AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::New(appInfo); | 356 AdblockPlus::JsEnginePtr jsEngine = AdblockPlus::JsEngine::New(appInfo); |
| 356 jsEngine->SetEventCallback("updateAvailable", &OnUpdateAvailable); | 357 jsEngine->SetEventCallback("updateAvailable", &OnUpdateAvailable); |
| 357 | 358 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 } | 402 } |
| 402 catch (std::runtime_error e) | 403 catch (std::runtime_error e) |
| 403 { | 404 { |
| 404 DebugException(e); | 405 DebugException(e); |
| 405 return 1; | 406 return 1; |
| 406 } | 407 } |
| 407 } | 408 } |
| 408 | 409 |
| 409 return 0; | 410 return 0; |
| 410 } | 411 } |
| OLD | NEW |