| OLD | NEW |
| 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 'use strict'; | 5 'use strict'; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Type of a Files.app's instance launch. | 8 * Type of a Files.app's instance launch. |
| 9 * @enum {number} | 9 * @enum {number} |
| 10 */ | 10 */ |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 Background.prototype.navigateToVolume = function(volumeId) { | 230 Background.prototype.navigateToVolume = function(volumeId) { |
| 231 VolumeManager.getInstance().then(function(volumeManager) { | 231 VolumeManager.getInstance().then(function(volumeManager) { |
| 232 var volumeInfoList = volumeManager.volumeInfoList; | 232 var volumeInfoList = volumeManager.volumeInfoList; |
| 233 var index = volumeInfoList.findIndex(volumeId); | 233 var index = volumeInfoList.findIndex(volumeId); |
| 234 var volumeInfo = volumeInfoList.item(index); | 234 var volumeInfo = volumeInfoList.item(index); |
| 235 return volumeInfo.resolveDisplayRoot(); | 235 return volumeInfo.resolveDisplayRoot(); |
| 236 }).then(function(entry) { | 236 }).then(function(entry) { |
| 237 launchFileManager( | 237 launchFileManager( |
| 238 {currentDirectoryURL: entry.toURL()}, | 238 {currentDirectoryURL: entry.toURL()}, |
| 239 /* App ID */ null, | 239 /* App ID */ null, |
| 240 LaunchType.FOCUS_ANY_OR_CREATE); | 240 LaunchType.FOCUS_SAME_OR_CREATE); |
| 241 }).catch(function(error) { | 241 }).catch(function(error) { |
| 242 console.error(error.stack || error); | 242 console.error(error.stack || error); |
| 243 }); | 243 }); |
| 244 }; | 244 }; |
| 245 | 245 |
| 246 /** | 246 /** |
| 247 * Wrapper for an app window. | 247 * Wrapper for an app window. |
| 248 * | 248 * |
| 249 * Expects the following from the app scripts: | 249 * Expects the following from the app scripts: |
| 250 * 1. The page load handler should initialize the app using |window.appState| | 250 * 1. The page load handler should initialize the app using |window.appState| |
| (...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 contexts: ['launcher'], | 941 contexts: ['launcher'], |
| 942 title: str('NEW_WINDOW_BUTTON_LABEL') | 942 title: str('NEW_WINDOW_BUTTON_LABEL') |
| 943 }); | 943 }); |
| 944 }; | 944 }; |
| 945 | 945 |
| 946 /** | 946 /** |
| 947 * Singleton instance of Background. | 947 * Singleton instance of Background. |
| 948 * @type {Background} | 948 * @type {Background} |
| 949 */ | 949 */ |
| 950 window.background = new Background(); | 950 window.background = new Background(); |
| OLD | NEW |