| 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 1256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1267 int tab_id, | 1267 int tab_id, |
| 1268 int window_id, | 1268 int window_id, |
| 1269 int render_process_host_id, | 1269 int render_process_host_id, |
| 1270 int routing_id, | 1270 int routing_id, |
| 1271 ResourceType::Type resource_type, | 1271 ResourceType::Type resource_type, |
| 1272 bool is_async_request, | 1272 bool is_async_request, |
| 1273 bool is_request_from_extension, | 1273 bool is_request_from_extension, |
| 1274 int* extra_info_spec, | 1274 int* extra_info_spec, |
| 1275 std::vector<const ExtensionWebRequestEventRouter::EventListener*>* | 1275 std::vector<const ExtensionWebRequestEventRouter::EventListener*>* |
| 1276 matching_listeners) { | 1276 matching_listeners) { |
| 1277 ExtensionRendererState::WebViewInfo web_view_info; |
| 1277 bool is_guest = ExtensionRendererState::GetInstance()-> | 1278 bool is_guest = ExtensionRendererState::GetInstance()-> |
| 1278 IsGuestProcess(render_process_host_id); | 1279 GetWebViewInfo(render_process_host_id, routing_id, &web_view_info); |
| 1279 std::set<EventListener>& listeners = listeners_[profile][event_name]; | 1280 std::set<EventListener>& listeners = listeners_[profile][event_name]; |
| 1280 for (std::set<EventListener>::iterator it = listeners.begin(); | 1281 for (std::set<EventListener>::iterator it = listeners.begin(); |
| 1281 it != listeners.end(); ++it) { | 1282 it != listeners.end(); ++it) { |
| 1282 if (!it->ipc_sender.get()) { | 1283 if (!it->ipc_sender.get()) { |
| 1283 // The IPC sender has been deleted. This listener will be removed soon | 1284 // The IPC sender has been deleted. This listener will be removed soon |
| 1284 // via a call to RemoveEventListener. For now, just skip it. | 1285 // via a call to RemoveEventListener. For now, just skip it. |
| 1285 continue; | 1286 continue; |
| 1286 } | 1287 } |
| 1287 | 1288 |
| 1288 if (is_guest && (it->target_process_id != render_process_host_id|| | 1289 if (is_guest && (it->target_process_id != render_process_host_id|| |
| (...skipping 740 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2029 } else if ((*it)->name().find("AdBlock") != std::string::npos) { | 2030 } else if ((*it)->name().find("AdBlock") != std::string::npos) { |
| 2030 adblock = true; | 2031 adblock = true; |
| 2031 } else { | 2032 } else { |
| 2032 other = true; | 2033 other = true; |
| 2033 } | 2034 } |
| 2034 } | 2035 } |
| 2035 } | 2036 } |
| 2036 | 2037 |
| 2037 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); | 2038 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); |
| 2038 } | 2039 } |
| OLD | NEW |