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

Unified Diff: extensions/renderer/dispatcher.cc

Issue 443723003: extensions: Register 'app' and 'webstore' bindings only if they are available. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 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 | « extensions/common/permissions/permissions_data.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/dispatcher.cc
diff --git a/extensions/renderer/dispatcher.cc b/extensions/renderer/dispatcher.cc
index f27eba89d7aa253ff021d15e56cd78abeec0cd75..0c63f63f486ef532d21304c0f8b80eb9a4cc761b 100644
--- a/extensions/renderer/dispatcher.cc
+++ b/extensions/renderer/dispatcher.cc
@@ -1003,8 +1003,11 @@ void Dispatcher::UpdateBindingsForContext(ScriptContext* context) {
case Feature::BLESSED_WEB_PAGE_CONTEXT: {
// Web page context; it's too expensive to run the full bindings code.
// Hard-code that the app and webstore APIs are available...
- RegisterBinding("app", context);
- RegisterBinding("webstore", context);
+ if (context->GetAvailability("app").is_available())
+ RegisterBinding("app", context);
+
+ if (context->GetAvailability("webstore").is_available())
+ RegisterBinding("webstore", context);
// ... and that the runtime API might be available if any extension can
// connect to it.
« no previous file with comments | « extensions/common/permissions/permissions_data.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698