| 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 * Map of all currently open app window. The key is an app id. | 8 * Map of all currently open app window. The key is an app id. |
| 9 */ | 9 */ |
| 10 var appWindows = {}; | 10 var appWindows = {}; |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 | 250 |
| 251 /** | 251 /** |
| 252 * @param {Object=} opt_appState App state. | 252 * @param {Object=} opt_appState App state. |
| 253 * @param {number=} opt_id Window id. | 253 * @param {number=} opt_id Window id. |
| 254 */ | 254 */ |
| 255 function launchFileManager(opt_appState, opt_id) { | 255 function launchFileManager(opt_appState, opt_id) { |
| 256 var id = opt_id || nextFileManagerWindowID; | 256 var id = opt_id || nextFileManagerWindowID; |
| 257 nextFileManagerWindowID = Math.max(nextFileManagerWindowID, id + 1); | 257 nextFileManagerWindowID = Math.max(nextFileManagerWindowID, id + 1); |
| 258 | 258 |
| 259 var appWindow = new AppWindowWrapper( | 259 var appWindow = new AppWindowWrapper( |
| 260 'main.html', FILES_ID_PREFIX + id, createFileManagerOptions); | 260 util.platform.newUI() ? 'main_new_ui.html' : 'main.html', |
| 261 FILES_ID_PREFIX + id, |
| 262 createFileManagerOptions); |
| 261 appWindow.launch(opt_appState || {}); | 263 appWindow.launch(opt_appState || {}); |
| 262 } | 264 } |
| 263 | 265 |
| 264 /** | 266 /** |
| 265 * Relaunch file manager windows based on the persisted state. | 267 * Relaunch file manager windows based on the persisted state. |
| 266 */ | 268 */ |
| 267 function reopenFileManagers() { | 269 function reopenFileManagers() { |
| 268 chrome.storage.local.get(function(items) { | 270 chrome.storage.local.get(function(items) { |
| 269 for (var key in items) { | 271 for (var key in items) { |
| 270 if (items.hasOwnProperty(key)) { | 272 if (items.hasOwnProperty(key)) { |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 } | 396 } |
| 395 | 397 |
| 396 chrome.app.runtime.onLaunched.addListener(launch); | 398 chrome.app.runtime.onLaunched.addListener(launch); |
| 397 chrome.app.runtime.onRestarted.addListener(restart); | 399 chrome.app.runtime.onRestarted.addListener(restart); |
| 398 | 400 |
| 399 function addExecuteHandler() { | 401 function addExecuteHandler() { |
| 400 chrome.fileBrowserHandler.onExecute.addListener(executeFileBrowserTask); | 402 chrome.fileBrowserHandler.onExecute.addListener(executeFileBrowserTask); |
| 401 } | 403 } |
| 402 | 404 |
| 403 addExecuteHandler(); | 405 addExecuteHandler(); |
| OLD | NEW |