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

Unified Diff: chrome/browser/extensions/extensions_service.cc

Issue 3163044: Expose Extension Bindings to Component Applications (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: review chanecs Created 10 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | chrome/browser/notifications/balloon_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extensions_service.cc
diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc
index 3fb4a9104b5da0d191dd0e11865b251e4f90415a..815ee49256721c5ca23800d0271770fc79df71aa 100644
--- a/chrome/browser/extensions/extensions_service.cc
+++ b/chrome/browser/extensions/extensions_service.cc
@@ -533,7 +533,7 @@ void ExtensionsService::LoadComponentExtensions() {
// In order for the --apps-gallery-url switch to work with the gallery
// process isolation, we must insert any provided value into the component
// app's launch url and web extent.
- if (extension->id() == extension_misc::kWebStoreAppId ) {
+ if (extension->id() == extension_misc::kWebStoreAppId) {
GURL gallery_url(CommandLine::ForCurrentProcess()
->GetSwitchValueASCII(switches::kAppsGalleryURL));
if (gallery_url.is_valid()) {
@@ -1255,6 +1255,16 @@ Extension* ExtensionsService::GetExtensionByWebExtent(const GURL& url) {
return NULL;
}
+bool ExtensionsService::ExtensionBindingsAllowed(const GURL& url) {
+ // Allow bindings for all packaged extension.
+ if (GetExtensionByURL(url))
+ return true;
+
+ // Allow bindings for all component, hosted apps.
+ Extension* extension = GetExtensionByWebExtent(url);
+ return (extension && extension->location() == Extension::COMPONENT);
+}
+
Extension* ExtensionsService::GetExtensionByOverlappingWebExtent(
const ExtensionExtent& extent) {
for (size_t i = 0; i < extensions_.size(); ++i) {
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | chrome/browser/notifications/balloon_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698