Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(683)

Side by Side Diff: extensions/renderer/dispatcher.cc

Issue 913393003: Restrict extensionview to chrome-extension:// (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/renderer/dispatcher.h" 5 #include "extensions/renderer/dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
334 module_system->Require("denyAppView"); 334 module_system->Require("denyAppView");
335 } 335 }
336 336
337 if (extensions::FeatureSwitch::surface_worker()->IsEnabled() && 337 if (extensions::FeatureSwitch::surface_worker()->IsEnabled() &&
338 context->GetAvailability("surfaceWorkerInternal").is_available()) { 338 context->GetAvailability("surfaceWorkerInternal").is_available()) {
339 module_system->Require("surfaceWorker"); 339 module_system->Require("surfaceWorker");
340 } 340 }
341 341
342 if (context->GetAvailability("extensionViewInternal").is_available()) { 342 if (context->GetAvailability("extensionViewInternal").is_available()) {
343 module_system->Require("extensionView"); 343 module_system->Require("extensionView");
344 module_system->Require("extensionViewApiMethods");
344 module_system->Require("extensionViewAttributes"); 345 module_system->Require("extensionViewAttributes");
345 } 346 }
346 347
347 // Note: setting up the WebView class here, not the chrome.webview API. 348 // Note: setting up the WebView class here, not the chrome.webview API.
348 // The API will be automatically set up when first used. 349 // The API will be automatically set up when first used.
349 if (context->GetAvailability("webViewInternal").is_available()) { 350 if (context->GetAvailability("webViewInternal").is_available()) {
350 module_system->Require("webView"); 351 module_system->Require("webView");
351 module_system->Require("webViewApiMethods"); 352 module_system->Require("webViewApiMethods");
352 module_system->Require("webViewAttributes"); 353 module_system->Require("webViewAttributes");
353 if (context->GetAvailability("webViewExperimentalInternal") 354 if (context->GetAvailability("webViewExperimentalInternal")
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS)); 587 IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS));
587 resources.push_back( 588 resources.push_back(
588 std::make_pair("webRequestInternal", 589 std::make_pair("webRequestInternal",
589 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS)); 590 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS));
590 // Note: webView not webview so that this doesn't interfere with the 591 // Note: webView not webview so that this doesn't interfere with the
591 // chrome.webview API bindings. 592 // chrome.webview API bindings.
592 resources.push_back(std::make_pair("guestView", IDR_GUEST_VIEW_JS)); 593 resources.push_back(std::make_pair("guestView", IDR_GUEST_VIEW_JS));
593 resources.push_back(std::make_pair("guestViewContainer", 594 resources.push_back(std::make_pair("guestViewContainer",
594 IDR_GUEST_VIEW_CONTAINER_JS)); 595 IDR_GUEST_VIEW_CONTAINER_JS));
595 resources.push_back(std::make_pair("extensionView", IDR_EXTENSION_VIEW_JS)); 596 resources.push_back(std::make_pair("extensionView", IDR_EXTENSION_VIEW_JS));
597 resources.push_back(std::make_pair("extensionViewApiMethods",
598 IDR_EXTENSION_VIEW_API_METHODS_JS));
596 resources.push_back(std::make_pair("extensionViewAttributes", 599 resources.push_back(std::make_pair("extensionViewAttributes",
597 IDR_EXTENSION_VIEW_ATTRIBUTES_JS)); 600 IDR_EXTENSION_VIEW_ATTRIBUTES_JS));
598 resources.push_back(std::make_pair("extensionViewConstants", 601 resources.push_back(std::make_pair("extensionViewConstants",
599 IDR_EXTENSION_VIEW_CONSTANTS_JS)); 602 IDR_EXTENSION_VIEW_CONSTANTS_JS));
603 resources.push_back(std::make_pair("extensionViewEvents",
604 IDR_EXTENSION_VIEW_EVENTS_JS));
600 resources.push_back(std::make_pair( 605 resources.push_back(std::make_pair(
601 "extensionViewInternal", IDR_EXTENSION_VIEW_INTERNAL_CUSTOM_BINDINGS_JS)); 606 "extensionViewInternal", IDR_EXTENSION_VIEW_INTERNAL_CUSTOM_BINDINGS_JS));
602 resources.push_back(std::make_pair("webView", IDR_WEB_VIEW_JS)); 607 resources.push_back(std::make_pair("webView", IDR_WEB_VIEW_JS));
603 resources.push_back(std::make_pair("surfaceWorker", IDR_SURFACE_VIEW_JS)); 608 resources.push_back(std::make_pair("surfaceWorker", IDR_SURFACE_VIEW_JS));
604 resources.push_back(std::make_pair("webViewActionRequests", 609 resources.push_back(std::make_pair("webViewActionRequests",
605 IDR_WEB_VIEW_ACTION_REQUESTS_JS)); 610 IDR_WEB_VIEW_ACTION_REQUESTS_JS));
606 resources.push_back(std::make_pair("webViewApiMethods", 611 resources.push_back(std::make_pair("webViewApiMethods",
607 IDR_WEB_VIEW_API_METHODS_JS)); 612 IDR_WEB_VIEW_API_METHODS_JS));
608 resources.push_back(std::make_pair("webViewAttributes", 613 resources.push_back(std::make_pair("webViewAttributes",
609 IDR_WEB_VIEW_ATTRIBUTES_JS)); 614 IDR_WEB_VIEW_ATTRIBUTES_JS));
(...skipping 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
1544 return v8::Handle<v8::Object>(); 1549 return v8::Handle<v8::Object>();
1545 1550
1546 if (bind_name) 1551 if (bind_name)
1547 *bind_name = split.back(); 1552 *bind_name = split.back();
1548 1553
1549 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) 1554 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context))
1550 : bind_object; 1555 : bind_object;
1551 } 1556 }
1552 1557
1553 } // namespace extensions 1558 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698