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

Unified Diff: chrome/renderer/resources/extensions/app_custom_bindings.js

Issue 9835039: Make app_custom_bindings.js lazily evaluated so it doesn't execute on every page load. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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/renderer/native_handler.cc ('k') | chrome/renderer/resources/extensions/webstore_custom_bindings.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/resources/extensions/app_custom_bindings.js
diff --git a/chrome/renderer/resources/extensions/app_custom_bindings.js b/chrome/renderer/resources/extensions/app_custom_bindings.js
index 9cae9d4c2777764d1d39e82a77593c61f1276092..1c8d1cbd98457f6870913fac5fe913956af9a80c 100644
--- a/chrome/renderer/resources/extensions/app_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/app_custom_bindings.js
@@ -5,9 +5,9 @@
// Custom bindings for the app API.
var appNatives = requireNative('app');
-var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
-chrome.app = {
+// This becomes chrome.app
+var app = {
getIsInstalled: appNatives.GetIsInstalled,
install: appNatives.Install,
getDetails: appNatives.GetDetails,
@@ -20,10 +20,11 @@ chrome.app = {
//
// So, define it manually, and let the getIsInstalled function act as its
// documentation.
-chrome.app.__defineGetter__('isInstalled', appNatives.GetIsInstalled);
+app.__defineGetter__('isInstalled', appNatives.GetIsInstalled);
// Called by app_bindings.cc.
-chromeHidden.app = {
+// This becomes chromeHidden.app
+var chromeHiddenApp = {
onGetAppNotifyChannelResponse: function(channelId, error, callbackId) {
if (callbackId) {
callbacks[callbackId](channelId, error);
@@ -40,7 +41,8 @@ chromeHidden.app = {
var callbacks = {};
var nextCallbackId = 1;
-chrome.appNotifications = {
+// This becomes chrome.appNotifications.
+var appNotifications = {
getChannel: function getChannel(clientId, callback) {
var callbackId = 0;
if (callback) {
@@ -50,3 +52,9 @@ chrome.appNotifications = {
appNatives.GetAppNotifyChannel(clientId, callbackId);
}
};
+
+// These must match the names in InstallAppBindings() in
+// extension_dispatcher.cc.
+exports.chromeApp = app;
+exports.chromeAppNotifications = appNotifications;
+exports.chromeHiddenApp = chromeHiddenApp;
« no previous file with comments | « chrome/renderer/native_handler.cc ('k') | chrome/renderer/resources/extensions/webstore_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698