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

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: lazy load webstore bindings as well 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
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..2f86093cd4d59d1bd42b81e7920f550f72dbe910 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,7 @@ chrome.appNotifications = {
appNatives.GetAppNotifyChannel(clientId, callbackId);
}
};
+
+exports.chromeApp = app;
not at google - send to devlin 2012/03/25 22:42:58 could you add like "must match the names in extens
koz (OOO until 15th September) 2012/03/26 01:36:09 Done.
+exports.chromeAppNotifications = appNotifications;
+exports.chromeHiddenApp = chromeHiddenApp;

Powered by Google App Engine
This is Rietveld 408576698