LEFT | RIGHT |
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-2017 eyeo GmbH | 3 * Copyright (C) 2006-2017 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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
513 auto prefValue = GetPref("allowed_connection_type"); | 513 auto prefValue = GetPref("allowed_connection_type"); |
514 if (prefValue->AsString().empty()) | 514 if (prefValue->AsString().empty()) |
515 return nullptr; | 515 return nullptr; |
516 return std::unique_ptr<std::string>(new std::string(prefValue->AsString())); | 516 return std::unique_ptr<std::string>(new std::string(prefValue->AsString())); |
517 } | 517 } |
518 | 518 |
519 void FilterEngine::FilterChanged(const FilterEngine::FilterChangeCallback& callb
ack, const JsValueList& params) const | 519 void FilterEngine::FilterChanged(const FilterEngine::FilterChangeCallback& callb
ack, const JsValueList& params) const |
520 { | 520 { |
521 std::string action(params.size() >= 1 && !params[0]->IsNull() ? params[0]->AsS
tring() : ""); | 521 std::string action(params.size() >= 1 && !params[0]->IsNull() ? params[0]->AsS
tring() : ""); |
522 JsValuePtr item(params.size() >= 2 ? params[1] : jsEngine->NewValue(false)); | 522 JsValuePtr item(params.size() >= 2 ? params[1] : jsEngine->NewValue(false)); |
523 callback(action, item); | 523 callback(action, *item); |
524 } | 524 } |
525 | 525 |
526 void FilterEngine::ShowNotification(const ShowNotificationCallback& callback, | 526 void FilterEngine::ShowNotification(const ShowNotificationCallback& callback, |
527 const JsValueList& params) const | 527 const JsValueList& params) const |
528 { | 528 { |
529 if (params.size() < 1) | 529 if (params.size() < 1) |
530 return; | 530 return; |
531 | 531 |
532 if (!params[0]->IsObject()) | 532 if (!params[0]->IsObject()) |
533 { | 533 { |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent
Url); | 574 FilterPtr filter = GetWhitelistingFilter(currentUrl, contentTypeMask, parent
Url); |
575 if (filter) | 575 if (filter) |
576 { | 576 { |
577 return filter; | 577 return filter; |
578 } | 578 } |
579 currentUrl = parentUrl; | 579 currentUrl = parentUrl; |
580 } | 580 } |
581 while (urlIterator != documentUrls.end()); | 581 while (urlIterator != documentUrls.end()); |
582 return FilterPtr(); | 582 return FilterPtr(); |
583 } | 583 } |
LEFT | RIGHT |