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

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: fix koz bool thing 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) 2011 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 (function() {
6 var natives = requireNative('app');
7 var GetIsInstalled = natives.GetIsInstalled;
8 var Install = natives.Install;
9 var GetDetails = natives.GetDetails;
10 var GetDetailsForFrame = natives.GetDetailsForFrame;
11 var GetAppNotifyChannel = natives.GetAppNotifyChannel;
12
13 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
14 var callbacks = {};
15 var nextCallbackId = 1;
16
17 chrome.app = new function() {
18 this.__defineGetter__('isInstalled', GetIsInstalled);
19 this.install = Install;
20 this.getDetails = GetDetails;
21 this.getDetailsForFrame = GetDetailsForFrame;
22 }();
23
24 chrome.appNotifications = new function() {
25 this.getChannel = function(clientId, callback) {
26 var callbackId = 0;
27 if (callback) {
28 callbackId = nextCallbackId++;
29 callbacks[callbackId] = callback;
30 }
31 GetAppNotifyChannel(clientId, callbackId);
32 };
33 }();
34
35 chromeHidden.app = {};
36 chromeHidden.app.onGetAppNotifyChannelResponse =
37 function(channelId, error, callbackId) {
38 if (callbackId) {
39 callbacks[callbackId](channelId, error);
40 delete callbacks[callbackId];
41 }
42 };
43 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698