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

Side by Side Diff: chrome/browser/resources/file_manager/js/file_manager_commands.js

Issue 18024002: Add the new window item to the Files.app's context menu on the launcher. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
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 '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
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
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 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698