| 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 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 930 CHECK(args_filtered->GetDictionary(0, &dict) && dict); | 930 CHECK(args_filtered->GetDictionary(0, &dict) && dict); |
| 931 if (!((*it)->extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS)) | 931 if (!((*it)->extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS)) |
| 932 dict->Remove(keys::kRequestHeadersKey, NULL); | 932 dict->Remove(keys::kRequestHeadersKey, NULL); |
| 933 if (!((*it)->extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS)) | 933 if (!((*it)->extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS)) |
| 934 dict->Remove(keys::kResponseHeadersKey, NULL); | 934 dict->Remove(keys::kResponseHeadersKey, NULL); |
| 935 | 935 |
| 936 base::JSONWriter::Write(args_filtered.get(), &json_args); | 936 base::JSONWriter::Write(args_filtered.get(), &json_args); |
| 937 | 937 |
| 938 ExtensionEventRouter::DispatchEvent( | 938 ExtensionEventRouter::DispatchEvent( |
| 939 (*it)->ipc_sender.get(), (*it)->extension_id, (*it)->sub_event_name, | 939 (*it)->ipc_sender.get(), (*it)->extension_id, (*it)->sub_event_name, |
| 940 json_args, GURL(), ExtensionEventRouter::USER_GESTURE_UNKNOWN); | 940 json_args, GURL(), ExtensionEventRouter::USER_GESTURE_UNKNOWN, |
| 941 EventFilteringInfo()); |
| 941 if ((*it)->extra_info_spec & | 942 if ((*it)->extra_info_spec & |
| 942 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) { | 943 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) { |
| 943 (*it)->blocked_requests.insert(request->identifier()); | 944 (*it)->blocked_requests.insert(request->identifier()); |
| 944 ++num_handlers_blocking; | 945 ++num_handlers_blocking; |
| 945 | 946 |
| 946 request->SetLoadStateParam( | 947 request->SetLoadStateParam( |
| 947 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION, | 948 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION, |
| 948 UTF8ToUTF16((*it)->extension_name))); | 949 UTF8ToUTF16((*it)->extension_name))); |
| 949 } | 950 } |
| 950 } | 951 } |
| (...skipping 820 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1771 } else if ((*it)->name().find("AdBlock") != std::string::npos) { | 1772 } else if ((*it)->name().find("AdBlock") != std::string::npos) { |
| 1772 adblock = true; | 1773 adblock = true; |
| 1773 } else { | 1774 } else { |
| 1774 other = true; | 1775 other = true; |
| 1775 } | 1776 } |
| 1776 } | 1777 } |
| 1777 } | 1778 } |
| 1778 | 1779 |
| 1779 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); | 1780 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); |
| 1780 } | 1781 } |
| OLD | NEW |