| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/extensions/api/web_request/web_request_api.h" | 5 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/json/json_writer.h" | 10 #include "base/json/json_writer.h" |
| (...skipping 918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 929 CHECK(args_filtered->GetDictionary(0, &dict) && dict); | 929 CHECK(args_filtered->GetDictionary(0, &dict) && dict); |
| 930 if (!((*it)->extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS)) | 930 if (!((*it)->extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS)) |
| 931 dict->Remove(keys::kRequestHeadersKey, NULL); | 931 dict->Remove(keys::kRequestHeadersKey, NULL); |
| 932 if (!((*it)->extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS)) | 932 if (!((*it)->extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS)) |
| 933 dict->Remove(keys::kResponseHeadersKey, NULL); | 933 dict->Remove(keys::kResponseHeadersKey, NULL); |
| 934 | 934 |
| 935 base::JSONWriter::Write(args_filtered.get(), &json_args); | 935 base::JSONWriter::Write(args_filtered.get(), &json_args); |
| 936 | 936 |
| 937 ExtensionEventRouter::DispatchEvent( | 937 ExtensionEventRouter::DispatchEvent( |
| 938 (*it)->ipc_sender.get(), (*it)->extension_id, (*it)->sub_event_name, | 938 (*it)->ipc_sender.get(), (*it)->extension_id, (*it)->sub_event_name, |
| 939 json_args, GURL(), ExtensionEventRouter::USER_GESTURE_UNKNOWN); | 939 json_args, GURL(), ExtensionEventRouter::USER_GESTURE_UNKNOWN, |
| 940 EventFilteringInfo()); |
| 940 if ((*it)->extra_info_spec & | 941 if ((*it)->extra_info_spec & |
| 941 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) { | 942 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) { |
| 942 (*it)->blocked_requests.insert(request->identifier()); | 943 (*it)->blocked_requests.insert(request->identifier()); |
| 943 ++num_handlers_blocking; | 944 ++num_handlers_blocking; |
| 944 | 945 |
| 945 request->SetLoadStateParam( | 946 request->SetLoadStateParam( |
| 946 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION, | 947 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION, |
| 947 UTF8ToUTF16((*it)->extension_name))); | 948 UTF8ToUTF16((*it)->extension_name))); |
| 948 } | 949 } |
| 949 } | 950 } |
| (...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1751 } else if ((*it)->name().find("AdBlock") != std::string::npos) { | 1752 } else if ((*it)->name().find("AdBlock") != std::string::npos) { |
| 1752 adblock = true; | 1753 adblock = true; |
| 1753 } else { | 1754 } else { |
| 1754 other = true; | 1755 other = true; |
| 1755 } | 1756 } |
| 1756 } | 1757 } |
| 1757 } | 1758 } |
| 1758 | 1759 |
| 1759 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); | 1760 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); |
| 1760 } | 1761 } |
| OLD | NEW |