| Index: chrome/browser/extensions/extension_protocols.cc
|
| diff --git a/chrome/browser/extensions/extension_protocols.cc b/chrome/browser/extensions/extension_protocols.cc
|
| index eb247ab74566558bcac840a1845cdede3191d7ee..68b9238e40197c7e10f8000cbdc1d562414de42c 100644
|
| --- a/chrome/browser/extensions/extension_protocols.cc
|
| +++ b/chrome/browser/extensions/extension_protocols.cc
|
| @@ -24,6 +24,7 @@
|
| #include "base/threading/thread_restrictions.h"
|
| #include "build/build_config.h"
|
| #include "chrome/browser/extensions/extension_info_map.h"
|
| +#include "chrome/browser/extensions/extension_renderer_state.h"
|
| #include "chrome/browser/extensions/image_loader.h"
|
| #include "chrome/common/chrome_paths.h"
|
| #include "chrome/common/extensions/background_info.h"
|
| @@ -35,6 +36,7 @@
|
| #include "chrome/common/extensions/manifest_handlers/shared_module_info.h"
|
| #include "chrome/common/extensions/manifest_url_handler.h"
|
| #include "chrome/common/extensions/web_accessible_resources_handler.h"
|
| +#include "chrome/common/extensions/webview_handler.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/resource_request_info.h"
|
| @@ -345,11 +347,6 @@ bool AllowExtensionResourceLoad(net::URLRequest* request,
|
| return true;
|
| }
|
|
|
| - if (is_incognito && !ExtensionCanLoadInIncognito(info, request->url().host(),
|
| - extension_info_map)) {
|
| - return false;
|
| - }
|
| -
|
| // The following checks are meant to replicate similar set of checks in the
|
| // renderer process, performed by ResourceRequestPolicy::CanRequestResource.
|
| // These are not exactly equivalent, because we don't have the same bits of
|
| @@ -368,6 +365,21 @@ bool AllowExtensionResourceLoad(net::URLRequest* request,
|
| return true;
|
| }
|
|
|
| + // Extensions with webview: allow loading certain resources by guest renderers
|
| + // with privileged partition IDs as specified in the manifest file.
|
| + ExtensionRendererState* renderer_state =
|
| + ExtensionRendererState::GetInstance();
|
| + ExtensionRendererState::WebViewInfo webview_info;
|
| + bool is_guest = renderer_state->GetWebViewInfo(info->GetChildID(),
|
| + info->GetRouteID(),
|
| + &webview_info);
|
| + std::string resource_path = request->url().path();
|
| + if (is_guest &&
|
| + extensions::WebviewInfo::IsResourceWebviewAccessible(
|
| + extension, webview_info.partition_id, resource_path)) {
|
| + return true;
|
| + }
|
| +
|
| if (!content::PageTransitionIsWebTriggerable(info->GetPageTransition()))
|
| return false;
|
|
|
| @@ -402,6 +414,12 @@ bool AllowExtensionResourceLoad(net::URLRequest* request,
|
| return true;
|
| }
|
|
|
| + if (is_incognito && !ExtensionCanLoadInIncognito(info, request->url().host(),
|
| + extension_info_map)) {
|
| + return false;
|
| + }
|
| +
|
| +
|
| // If there aren't any explicitly marked web accessible resources, the
|
| // load should be allowed only if it is by DevTools. A close approximation is
|
| // checking if the extension contains a DevTools page.
|
|
|