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

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

Issue 9657026: Revert 125801 - Implement a module system for the extension bindings JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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
Property Changes:
Deleted: svn:mime-type
- text/javascript
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 var webstoreNatives = requireNative('webstore'); 5 var chrome = chrome || {};
6 var Install = webstoreNatives.Install; 6 (function() {
7 native function GetChromeHidden();
8 native function Install(preferredStoreUrl, onSuccess, onFailure);
7 9
8 var chromeHidden = requireNative('chrome_hidden').GetChromeHidden(); 10 var chromeHidden = GetChromeHidden();
9 var pendingInstalls = {}; 11 var pendingInstalls = {};
10 chrome.webstore = new function() { 12 chrome.webstore = new function() {
11 this.install = function( 13 this.install = function(
12 preferredStoreLinkUrl, successCallback, failureCallback) { 14 preferredStoreLinkUrl, successCallback, failureCallback) {
13 var installId = Install( 15 var installId = Install(
14 preferredStoreLinkUrl, successCallback, failureCallback); 16 preferredStoreLinkUrl, successCallback, failureCallback);
15 if (installId !== undefined) { 17 if (installId !== undefined) {
16 pendingInstalls[installId] = { 18 pendingInstalls[installId] = {
17 successCallback: successCallback, 19 successCallback: successCallback,
18 failureCallback: failureCallback 20 failureCallback: failureCallback
(...skipping 13 matching lines...) Expand all
32 try { 34 try {
33 if (success && pendingInstall.successCallback) { 35 if (success && pendingInstall.successCallback) {
34 pendingInstall.successCallback(); 36 pendingInstall.successCallback();
35 } else if (!success && pendingInstall.failureCallback) { 37 } else if (!success && pendingInstall.failureCallback) {
36 pendingInstall.failureCallback(error); 38 pendingInstall.failureCallback(error);
37 } 39 }
38 } finally { 40 } finally {
39 delete pendingInstall[installId]; 41 delete pendingInstall[installId];
40 } 42 }
41 } 43 }
44 })();
OLDNEW
« no previous file with comments | « chrome/renderer/resources/extensions/web_request_custom_bindings.js ('k') | chrome/renderer/resources/require.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698