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

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

Issue 11571014: Lazy load chrome.* APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: android compilation Created 7 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) 2012 The Chromium Authors. All rights reserved. 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 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 // Custom bindings for the webstore API. 5 // Custom binding for the webstore API.
6 6
7 var webstoreNatives = requireNative('webstore'); 7 var webstoreNatives = requireNative('webstore');
8 8
9 function Installer() { 9 function Installer() {
10 this._pendingInstall = null; 10 this._pendingInstall = null;
11 } 11 }
12 12
13 Installer.prototype.install = function(url, onSuccess, onFailure) { 13 Installer.prototype.install = function(url, onSuccess, onFailure) {
14 if (this._pendingInstall) { 14 if (this._pendingInstall) {
15 throw 'A Chrome Web Store installation is already pending.'; 15 throw 'A Chrome Web Store installation is already pending.';
(...skipping 26 matching lines...) Expand all
42 }; 42 };
43 43
44 var installer = new Installer(); 44 var installer = new Installer();
45 45
46 var chromeWebstore = { 46 var chromeWebstore = {
47 install: function install(url, onSuccess, onFailure) { 47 install: function install(url, onSuccess, onFailure) {
48 installer.install(url, onSuccess, onFailure); 48 installer.install(url, onSuccess, onFailure);
49 } 49 }
50 }; 50 };
51 51
52 // Called by webstore_bindings.cc. 52 // Called by webstore_binding.cc.
53 var chromeHiddenWebstore = { 53 var chromeHiddenWebstore = {
54 onInstallResponse: function(installId, success, error) { 54 onInstallResponse: function(installId, success, error) {
55 installer.onInstallResponse(installId, success, error); 55 installer.onInstallResponse(installId, success, error);
56 } 56 }
57 }; 57 };
58 58
59 // These must match the names in InstallWebstoreBindings in 59 // These must match the names in InstallWebstorebinding in
60 // chrome/renderer/extensions/dispatcher.cc. 60 // chrome/renderer/extensions/dispatcher.cc.
61 exports.chromeWebstore = chromeWebstore; 61 exports.chromeWebstore = chromeWebstore;
62 exports.chromeHiddenWebstore = chromeHiddenWebstore; 62 exports.chromeHiddenWebstore = chromeHiddenWebstore;
OLDNEW
« no previous file with comments | « chrome/renderer/resources/extensions/web_view_experimental.js ('k') | chrome/renderer/resources/renderer_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698