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 var CommandUtil = {}; | 7 var CommandUtil = {}; |
8 | 8 |
9 /** | 9 /** |
10 * Extracts root on which command event was dispatched. | 10 * Extracts root on which command event was dispatched. |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 !fileManager.isRenamingInProgress() && | 250 !fileManager.isRenamingInProgress() && |
251 !directoryModel.isSearching() && | 251 !directoryModel.isSearching() && |
252 !directoryModel.isScanning(); | 252 !directoryModel.isScanning(); |
253 } | 253 } |
254 }; | 254 }; |
255 | 255 |
256 /** | 256 /** |
257 * Initiates new window creation. | 257 * Initiates new window creation. |
258 */ | 258 */ |
259 Commands.newWindowCommand = { | 259 Commands.newWindowCommand = { |
260 execute: function(event, fileManager) { | 260 execute: function(event, fileManager, directoryModel) { |
261 chrome.fileBrowserPrivate.openNewWindow(document.location.href); | 261 chrome.runtime.getBackgroundPage(function(background) { |
| 262 var appState = { |
| 263 defaultPath: directoryModel.getCurrentDirPath() |
| 264 }; |
| 265 background.launchFileManager(appState); |
| 266 }); |
262 }, | 267 }, |
263 canExecute: function(event, fileManager) { | 268 canExecute: function(event, fileManager) { |
264 event.canExecute = (fileManager.dialogType == DialogType.FULL_PAGE); | 269 event.canExecute = (fileManager.dialogType == DialogType.FULL_PAGE); |
265 } | 270 } |
266 }; | 271 }; |
267 | 272 |
268 /** | 273 /** |
269 * Changed the default app handling inserted media. | 274 * Changed the default app handling inserted media. |
270 */ | 275 */ |
271 Commands.changeDefaultAppCommand = { | 276 Commands.changeDefaultAppCommand = { |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
518 | 523 |
519 /** | 524 /** |
520 * Reset the zoom factor. | 525 * Reset the zoom factor. |
521 */ | 526 */ |
522 Commands.zoomResetCommand = { | 527 Commands.zoomResetCommand = { |
523 execute: function(event) { | 528 execute: function(event) { |
524 chrome.fileBrowserPrivate.zoom('reset'); | 529 chrome.fileBrowserPrivate.zoom('reset'); |
525 }, | 530 }, |
526 canExecute: CommandUtil.canExecuteAlways | 531 canExecute: CommandUtil.canExecuteAlways |
527 }; | 532 }; |
OLD | NEW |