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 1060 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1071 // Filter out the optional keys that this listener didn't request. | 1071 // Filter out the optional keys that this listener didn't request. |
1072 scoped_ptr<ListValue> args_filtered(args.DeepCopy()); | 1072 scoped_ptr<ListValue> args_filtered(args.DeepCopy()); |
1073 DictionaryValue* dict = NULL; | 1073 DictionaryValue* dict = NULL; |
1074 CHECK(args_filtered->GetDictionary(0, &dict) && dict); | 1074 CHECK(args_filtered->GetDictionary(0, &dict) && dict); |
1075 if (!((*it)->extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS)) | 1075 if (!((*it)->extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS)) |
1076 dict->Remove(keys::kRequestHeadersKey, NULL); | 1076 dict->Remove(keys::kRequestHeadersKey, NULL); |
1077 if (!((*it)->extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS)) | 1077 if (!((*it)->extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS)) |
1078 dict->Remove(keys::kResponseHeadersKey, NULL); | 1078 dict->Remove(keys::kResponseHeadersKey, NULL); |
1079 | 1079 |
1080 extensions::EventRouter::DispatchEvent( | 1080 extensions::EventRouter::DispatchEvent( |
1081 (*it)->ipc_sender.get(), (*it)->extension_id, (*it)->sub_event_name, | 1081 (*it)->ipc_sender.get(), static_cast<Profile*>(profile), |
Matt Perry
2013/01/25 21:24:17
There's a reason that |profile| is a void* - so yo
mvrable
2013/01/28 16:27:36
Fixed I think--does the new version look all right
| |
1082 (*it)->extension_id, (*it)->sub_event_name, | |
1082 args_filtered.Pass(), GURL(), | 1083 args_filtered.Pass(), GURL(), |
1083 extensions::EventRouter::USER_GESTURE_UNKNOWN, | 1084 extensions::EventRouter::USER_GESTURE_UNKNOWN, |
1084 extensions::EventFilteringInfo()); | 1085 extensions::EventFilteringInfo()); |
1085 if ((*it)->extra_info_spec & | 1086 if ((*it)->extra_info_spec & |
1086 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) { | 1087 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) { |
1087 (*it)->blocked_requests.insert(request->identifier()); | 1088 (*it)->blocked_requests.insert(request->identifier()); |
1088 ++num_handlers_blocking; | 1089 ++num_handlers_blocking; |
1089 | 1090 |
1090 request->SetLoadStateParam( | 1091 request->SetLoadStateParam( |
1091 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION, | 1092 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION, |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2007 } else if ((*it)->name().find("AdBlock") != std::string::npos) { | 2008 } else if ((*it)->name().find("AdBlock") != std::string::npos) { |
2008 adblock = true; | 2009 adblock = true; |
2009 } else { | 2010 } else { |
2010 other = true; | 2011 other = true; |
2011 } | 2012 } |
2012 } | 2013 } |
2013 } | 2014 } |
2014 | 2015 |
2015 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); | 2016 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); |
2016 } | 2017 } |
OLD | NEW |