Index: chrome/browser/extensions/api/web_request/web_request_api.cc |
diff --git a/chrome/browser/extensions/api/web_request/web_request_api.cc b/chrome/browser/extensions/api/web_request/web_request_api.cc |
index 107d4b3e5899152d386c88971aa03c10a2494e45..6acc3bfc8ed23d9e196dc9e204063db91ea4222f 100644 |
--- a/chrome/browser/extensions/api/web_request/web_request_api.cc |
+++ b/chrome/browser/extensions/api/web_request/web_request_api.cc |
@@ -1285,7 +1285,7 @@ void ExtensionWebRequestEventRouter::GetMatchingListenersImpl( |
continue; |
} |
- if (is_guest && (it->target_process_id != render_process_host_id|| |
+ if (is_guest && (it->target_process_id != render_process_host_id || |
it->target_route_id != routing_id)) |
continue; |
@@ -1300,7 +1300,7 @@ void ExtensionWebRequestEventRouter::GetMatchingListenersImpl( |
resource_type) == it->filter.types.end()) |
continue; |
- if (!WebRequestPermissions::CanExtensionAccessURL( |
+ if (!is_guest && !WebRequestPermissions::CanExtensionAccessURL( |
extension_info_map, it->extension_id, url, crosses_incognito, true)) |
continue; |
@@ -1825,6 +1825,12 @@ bool WebRequestAddEventListener::RunImpl() { |
std::string sub_event_name; |
EXTENSION_FUNCTION_VALIDATE(args_->GetString(4, &sub_event_name)); |
+ int target_process_id = -1; |
+ EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(5, &target_process_id)); |
+ |
+ int target_route_id = -1; |
+ EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(6, &target_route_id)); |
+ |
const Extension* extension = |
extension_info_map()->extensions().GetByID(extension_id()); |
std::string extension_name = extension ? extension->name() : extension_id(); |
@@ -1832,7 +1838,7 @@ bool WebRequestAddEventListener::RunImpl() { |
// We check automatically whether the extension has the 'webRequest' |
// permission. For blocking calls we require the additional permission |
// 'webRequestBlocking'. |
- if ((extra_info_spec & |
+ if ((!extension->is_app() && extra_info_spec & |
(ExtensionWebRequestEventRouter::ExtraInfoSpec::BLOCKING | |
ExtensionWebRequestEventRouter::ExtraInfoSpec::ASYNC_BLOCKING)) && |
!extension->HasAPIPermission( |
@@ -1847,7 +1853,7 @@ bool WebRequestAddEventListener::RunImpl() { |
// http://www.example.com/bar/*. |
// For this reason we do only a coarse check here to warn the extension |
// developer if he does something obviously wrong. |
- if (extension->GetEffectiveHostPermissions().is_empty()) { |
+ if (!extension->is_app() && extension->GetEffectiveHostPermissions().is_empty()) { |
error_ = keys::kHostPermissionsRequired; |
return false; |
} |
@@ -1856,7 +1862,8 @@ bool WebRequestAddEventListener::RunImpl() { |
ExtensionWebRequestEventRouter::GetInstance()->AddEventListener( |
profile_id(), extension_id(), extension_name, |
event_name, sub_event_name, filter, |
- extra_info_spec, -1, -1, ipc_sender_weak()); |
+ extra_info_spec, target_process_id, target_route_id, |
+ ipc_sender_weak()); |
EXTENSION_FUNCTION_VALIDATE(success); |
helpers::ClearCacheOnNavigation(); |