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