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/webrequest/webrequest_api.h" | 5 #include "chrome/browser/extensions/api/webrequest/webrequest_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 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 CHECK(args_filtered->GetDictionary(0, &dict) && dict); | 969 CHECK(args_filtered->GetDictionary(0, &dict) && dict); |
970 if (!((*it)->extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS)) | 970 if (!((*it)->extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS)) |
971 dict->Remove(keys::kRequestHeadersKey, NULL); | 971 dict->Remove(keys::kRequestHeadersKey, NULL); |
972 if (!((*it)->extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS)) | 972 if (!((*it)->extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS)) |
973 dict->Remove(keys::kResponseHeadersKey, NULL); | 973 dict->Remove(keys::kResponseHeadersKey, NULL); |
974 | 974 |
975 base::JSONWriter::Write(args_filtered.get(), false, &json_args); | 975 base::JSONWriter::Write(args_filtered.get(), false, &json_args); |
976 | 976 |
977 ExtensionEventRouter::DispatchEvent( | 977 ExtensionEventRouter::DispatchEvent( |
978 (*it)->ipc_sender.get(), (*it)->extension_id, (*it)->sub_event_name, | 978 (*it)->ipc_sender.get(), (*it)->extension_id, (*it)->sub_event_name, |
979 json_args, GURL()); | 979 json_args, GURL(), ExtensionEventRouter::USER_GESTURE_UNKNOWN); |
980 if ((*it)->extra_info_spec & | 980 if ((*it)->extra_info_spec & |
981 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) { | 981 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) { |
982 (*it)->blocked_requests.insert(request->identifier()); | 982 (*it)->blocked_requests.insert(request->identifier()); |
983 ++num_handlers_blocking; | 983 ++num_handlers_blocking; |
984 | 984 |
985 request->SetLoadStateParam( | 985 request->SetLoadStateParam( |
986 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION, | 986 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION, |
987 UTF8ToUTF16((*it)->extension_name))); | 987 UTF8ToUTF16((*it)->extension_name))); |
988 } | 988 } |
989 } | 989 } |
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1739 } else if ((*it)->name().find("AdBlock") != std::string::npos) { | 1739 } else if ((*it)->name().find("AdBlock") != std::string::npos) { |
1740 adblock = true; | 1740 adblock = true; |
1741 } else { | 1741 } else { |
1742 other = true; | 1742 other = true; |
1743 } | 1743 } |
1744 } | 1744 } |
1745 } | 1745 } |
1746 | 1746 |
1747 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); | 1747 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); |
1748 } | 1748 } |
OLD | NEW |