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/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1092 DictionaryValue* dict = NULL; | 1092 DictionaryValue* dict = NULL; |
1093 CHECK(args_filtered->GetDictionary(0, &dict) && dict); | 1093 CHECK(args_filtered->GetDictionary(0, &dict) && dict); |
1094 if (!((*it)->extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS)) | 1094 if (!((*it)->extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS)) |
1095 dict->Remove(keys::kRequestHeadersKey, NULL); | 1095 dict->Remove(keys::kRequestHeadersKey, NULL); |
1096 if (!((*it)->extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS)) | 1096 if (!((*it)->extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS)) |
1097 dict->Remove(keys::kResponseHeadersKey, NULL); | 1097 dict->Remove(keys::kResponseHeadersKey, NULL); |
1098 | 1098 |
1099 extensions::EventRouter::DispatchEvent( | 1099 extensions::EventRouter::DispatchEvent( |
1100 (*it)->ipc_sender.get(), profile_id, | 1100 (*it)->ipc_sender.get(), profile_id, |
1101 (*it)->extension_id, (*it)->sub_event_name, | 1101 (*it)->extension_id, (*it)->sub_event_name, |
1102 args_filtered.Pass(), GURL(), | 1102 args_filtered.Pass(), |
1103 extensions::EventRouter::USER_GESTURE_UNKNOWN, | 1103 extensions::EventRouter::USER_GESTURE_UNKNOWN, |
1104 extensions::EventFilteringInfo()); | 1104 extensions::EventFilteringInfo()); |
1105 if ((*it)->extra_info_spec & | 1105 if ((*it)->extra_info_spec & |
1106 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) { | 1106 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) { |
1107 (*it)->blocked_requests.insert(request->identifier()); | 1107 (*it)->blocked_requests.insert(request->identifier()); |
1108 ++num_handlers_blocking; | 1108 ++num_handlers_blocking; |
1109 | 1109 |
1110 request->SetLoadStateParam( | 1110 request->SetLoadStateParam( |
1111 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION, | 1111 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION, |
1112 UTF8ToUTF16((*it)->extension_name))); | 1112 UTF8ToUTF16((*it)->extension_name))); |
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2264 } else if ((*it)->name().find("AdBlock") != std::string::npos) { | 2264 } else if ((*it)->name().find("AdBlock") != std::string::npos) { |
2265 adblock = true; | 2265 adblock = true; |
2266 } else { | 2266 } else { |
2267 other = true; | 2267 other = true; |
2268 } | 2268 } |
2269 } | 2269 } |
2270 } | 2270 } |
2271 | 2271 |
2272 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); | 2272 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); |
2273 } | 2273 } |
OLD | NEW |