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

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

Issue 15841013: Make miscellaneous_bindings and event_bindings Required as needed. Previously (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 0c2011d18737f436a103952dbd48182d2fce42a1..b55fa7636bab95b422cce4c52d69dc97bbff7eb0 100644
--- a/chrome/renderer/resources/extensions/app_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/app_custom_bindings.js
@@ -7,7 +7,7 @@
var GetAvailability = requireNative('v8_context').GetAvailability;
if (!GetAvailability('app').is_available) {
exports.chromeApp = {};
- exports.chromeHiddenApp = {};
+ exports.onInstallStateResponse = function(){};
return;
}
@@ -61,17 +61,13 @@ else
wrapForLogging(appNatives.GetIsInstalled));
// Called by app_bindings.cc.
-// This becomes chromeHidden.app
-var chromeHiddenApp = {
- onInstallStateResponse: function(state, callbackId) {
- if (callbackId) {
- callbacks[callbackId](state);
- delete callbacks[callbackId];
- }
- }
-};
+function onInstallStateResponse(state, callbackId) {
+ var callback = callbacks[callbackId];
+ delete callbacks[callbackId];
+ if (callback)
+ callback(state);
+}
-// TODO(kalman): move this stuff to its own custom bindings.
var callbacks = {};
var nextCallbackId = 1;
@@ -83,7 +79,10 @@ app.installState = function getInstallState(callback) {
if (extensionId)
app.installState = wrapForLogging(app.installState);
-// These must match the names in InstallAppbinding() in
+// This must match InstallAppbinding() in
// chrome/renderer/extensions/dispatcher.cc.
+//
+// TODO(kalman): we can get rid of this when the bindings code can be run in
+// all renderers - very soon!
exports.chromeApp = app;
-exports.chromeHiddenApp = chromeHiddenApp;
+exports.onInstallStateResponse = onInstallStateResponse;
« no previous file with comments | « chrome/renderer/extensions/webstore_bindings.cc ('k') | chrome/renderer/resources/extensions/app_runtime_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698