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

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

Issue 10174001: Add an API for hosted apps to check their install and running states. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 1c8d1cbd98457f6870913fac5fe913956af9a80c..16db32de4bef9ee55cc8e62dd58e77b600e97cc4 100644
--- a/chrome/renderer/resources/extensions/app_custom_bindings.js
+++ b/chrome/renderer/resources/extensions/app_custom_bindings.js
@@ -11,7 +11,8 @@ var app = {
getIsInstalled: appNatives.GetIsInstalled,
install: appNatives.Install,
getDetails: appNatives.GetDetails,
- getDetailsForFrame: appNatives.GetDetailsForFrame
+ getDetailsForFrame: appNatives.GetDetailsForFrame,
+ runningState: appNatives.GetRunningState
};
// Tricky; "getIsInstalled" is actually exposed as the getter "isInstalled",
@@ -30,6 +31,13 @@ var chromeHiddenApp = {
callbacks[callbackId](channelId, error);
delete callbacks[callbackId];
}
+ },
+
+ onInstallStateResponse: function(state, callbackId) {
+ if (callbackId) {
+ callbacks[callbackId](state);
+ delete callbacks[callbackId];
+ }
}
};
@@ -53,6 +61,12 @@ var appNotifications = {
}
};
+app.installState = function getInstallState(callback) {
+ var callbackId = nextCallbackId++;
+ callbacks[callbackId] = callback;
+ appNatives.GetInstallState(callbackId);
+};
+
// These must match the names in InstallAppBindings() in
// extension_dispatcher.cc.
exports.chromeApp = app;
« no previous file with comments | « chrome/renderer/extensions/app_bindings.cc ('k') | chrome/test/data/extensions/get_app_details_for_frame_reversed.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698