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

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

Issue 9386001: Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: base files missing? 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
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 var chrome = chrome || {};
6 (function() { 5 (function() {
7 native function GetChromeHidden(); 6 var natives = requireNative('app');
8 native function GetIsInstalled(); 7 var GetIsInstalled = natives.GetIsInstalled;
9 native function Install(); 8 var Install = natives.Install;
10 native function GetDetails(); 9 var GetDetails = natives.GetDetails;
11 native function GetDetailsForFrame(); 10 var GetDetailsForFrame = natives.GetDetailsForFrame;
12 native function GetAppNotifyChannel(); 11 var GetAppNotifyChannel = natives.GetAppNotifyChannel;
13 12
14 var chromeHidden = GetChromeHidden(); 13 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden();
15 var callbacks = {}; 14 var callbacks = {};
16 var nextCallbackId = 1; 15 var nextCallbackId = 1;
17 16
18 chrome.app = new function() { 17 chrome.app = new function() {
19 this.__defineGetter__('isInstalled', GetIsInstalled); 18 this.__defineGetter__('isInstalled', GetIsInstalled);
20 this.install = Install; 19 this.install = Install;
21 this.getDetails = GetDetails; 20 this.getDetails = GetDetails;
22 this.getDetailsForFrame = GetDetailsForFrame; 21 this.getDetailsForFrame = GetDetailsForFrame;
23 }(); 22 }();
24 23
(...skipping 10 matching lines...) Expand all
35 34
36 chromeHidden.app = {}; 35 chromeHidden.app = {};
37 chromeHidden.app.onGetAppNotifyChannelResponse = 36 chromeHidden.app.onGetAppNotifyChannelResponse =
38 function(channelId, error, callbackId) { 37 function(channelId, error, callbackId) {
39 if (callbackId) { 38 if (callbackId) {
40 callbacks[callbackId](channelId, error); 39 callbacks[callbackId](channelId, error);
41 delete callbacks[callbackId]; 40 delete callbacks[callbackId];
42 } 41 }
43 }; 42 };
44 })(); 43 })();
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698