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

Unified Diff: chrome/browser/resources/file_manager/js/app_installer.js

Issue 39123003: [Files.app] Split the JavaScript files into subdirectories: common, background, and foreground (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed test failure. Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/file_manager/js/app_installer.js
diff --git a/chrome/browser/resources/file_manager/js/app_installer.js b/chrome/browser/resources/file_manager/js/app_installer.js
deleted file mode 100644
index 7914d6e458f5930d5d3aa29979e75f8bd7830be5..0000000000000000000000000000000000000000
--- a/chrome/browser/resources/file_manager/js/app_installer.js
+++ /dev/null
@@ -1,79 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-'use strict';
-
-/**
- * Manage the installation of apps.
- *
- * @param {string} itemId Item id to be installed.
- * @constructor
- * @extends {cr.EventType}
- */
-function AppInstaller(itemId) {
- this.itemId_ = itemId;
- this.callback_ = null;
-
- Object.seal(this);
-}
-
-AppInstaller.prototype = {
-};
-
-/**
- * Type of result.
- *
- * @enum {string}
- * @const
- */
-AppInstaller.Result = {
- SUCCESS: 'AppInstaller.success',
- CANCELLED: 'AppInstaller.cancelled',
- ERROR: 'AppInstaller.error'
-};
-Object.freeze(AppInstaller.Result);
-
-/**
- * Error message for user cancellation. This must be match with the constant
- * 'kUserCancelledError' in C/B/extensions/webstore_standalone_installer.cc.
- * @type {string}
- * @const
- * @private
- */
-AppInstaller.USER_CANCELLED_ERROR_STR_ = 'User cancelled install';
-
-/**
- * Start an installation.
- * @param {function(boolean, string)} callback Called when the installation is
- * finished.
- */
-AppInstaller.prototype.install = function(callback) {
- this.callback_ = callback;
- chrome.fileBrowserPrivate.installWebstoreItem(
- this.itemId_,
- function() {
- this.onInstallCompleted_(chrome.runtime.lastError);
- }.bind(this));
-};
-
-/**
- * Called when the installation is completed.
- *
- * @param {{message: string}?} error Null if the installation is success,
- * otherwise an object which contains error message.
- * @private
- */
-AppInstaller.prototype.onInstallCompleted_ = function(error) {
- var installerResult = AppInstaller.Result.SUCCESS;
- var errorMessage = '';
- if (error) {
- installerResult =
- error.message == AppInstaller.USER_CANCELLED_ERROR_STR_ ?
- AppInstaller.Result.CANCELLED :
- AppInstaller.Result.ERROR;
- errorMessage = error.message;
- }
- this.callback_(installerResult, errorMessage);
- this.callback_ = null;
-};
« no previous file with comments | « chrome/browser/resources/file_manager/js/action_choice_util.js ('k') | chrome/browser/resources/file_manager/js/async_util.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698