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

Side by Side Diff: chrome/renderer/resources/extensions/app.js

Issue 9460002: Convert app_bindings.js to the schema_generated_bindings.js infrastructure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make test extension ID tests pass 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 var natives = requireNative('app');
6 var GetIsInstalled = natives.GetIsInstalled;
7 var Install = natives.Install;
8 var GetDetails = natives.GetDetails;
9 var GetDetailsForFrame = natives.GetDetailsForFrame;
10 var GetAppNotifyChannel = natives.GetAppNotifyChannel;
11
12 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
13 var callbacks = {};
14 var nextCallbackId = 1;
15
16 chrome.app = new function() {
17 this.__defineGetter__('isInstalled', GetIsInstalled);
18 this.install = Install;
19 this.getDetails = GetDetails;
20 this.getDetailsForFrame = GetDetailsForFrame;
21 }();
22
23 chrome.appNotifications = new function() {
24 this.getChannel = function(clientId, callback) {
25 var callbackId = 0;
26 if (callback) {
27 callbackId = nextCallbackId++;
28 callbacks[callbackId] = callback;
29 }
30 GetAppNotifyChannel(clientId, callbackId);
31 };
32 }();
33
34 chromeHidden.app = {};
35 chromeHidden.app.onGetAppNotifyChannelResponse =
36 function(channelId, error, callbackId) {
37 if (callbackId) {
38 callbacks[callbackId](channelId, error);
39 delete callbacks[callbackId];
40 }
41 };
OLDNEW
« no previous file with comments | « chrome/renderer/resource_bundle_source_map.cc ('k') | chrome/renderer/resources/extensions/app_custom_bindings.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698