| Index: extensions/renderer/dispatcher.cc
|
| diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
|
| index fa242177fa2341141849ce945ff916f1a5f9a356..c014d2749e2f002e53d1f4829115a92e0135d6c8 100644
|
| --- a/extensions/renderer/dispatcher.cc
|
| +++ b/extensions/renderer/dispatcher.cc
|
| @@ -365,12 +365,6 @@ bool Dispatcher::CheckContextAccessToExtensionAPI(
|
| return false;
|
| }
|
|
|
| - if (!context->extension()) {
|
| - context->isolate()->ThrowException(v8::Exception::Error(
|
| - v8::String::NewFromUtf8(context->isolate(), "Not in an extension.")));
|
| - return false;
|
| - }
|
| -
|
| // Theoretically we could end up with bindings being injected into sandboxed
|
| // frames, for example content scripts. Don't let them execute API functions.
|
| blink::WebFrame* frame = context->web_frame();
|
| @@ -847,7 +841,8 @@ void Dispatcher::UpdateBindingsForContext(ScriptContext* context) {
|
|
|
| case Feature::BLESSED_EXTENSION_CONTEXT:
|
| case Feature::UNBLESSED_EXTENSION_CONTEXT:
|
| - case Feature::CONTENT_SCRIPT_CONTEXT: {
|
| + case Feature::CONTENT_SCRIPT_CONTEXT:
|
| + case Feature::WEBUI_CONTEXT: {
|
| // Extension context; iterate through all the APIs and bind the available
|
| // ones.
|
| const FeatureProvider* api_feature_provider =
|
| @@ -1125,10 +1120,13 @@ Feature::Context Dispatcher::ClassifyJavaScriptContext(
|
| : Feature::UNBLESSED_EXTENSION_CONTEXT;
|
| }
|
|
|
| - if (url.is_valid())
|
| - return Feature::WEB_PAGE_CONTEXT;
|
| + if (!url.is_valid())
|
| + return Feature::UNSPECIFIED_CONTEXT;
|
| +
|
| + if (url.SchemeIs(content::kChromeUIScheme))
|
| + return Feature::WEBUI_CONTEXT;
|
|
|
| - return Feature::UNSPECIFIED_CONTEXT;
|
| + return Feature::WEB_PAGE_CONTEXT;
|
| }
|
|
|
| v8::Handle<v8::Object> Dispatcher::GetOrCreateObject(
|
|
|