| 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 var CommandUtil = {}; | 5 var CommandUtil = {}; |
| 6 | 6 |
| 7 /** | 7 /** |
| 8 * Extracts root on which command event was dispatched. | 8 * Extracts root on which command event was dispatched. |
| 9 * | 9 * |
| 10 * @param {Event} event Command event for which to retrieve root to operate on. | 10 * @param {Event} event Command event for which to retrieve root to operate on. |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 }; | 114 }; |
| 115 | 115 |
| 116 /** | 116 /** |
| 117 * Imports photos from external drive | 117 * Imports photos from external drive |
| 118 */ | 118 */ |
| 119 Commands.importCommand = { | 119 Commands.importCommand = { |
| 120 execute: function(event, rootsList) { | 120 execute: function(event, rootsList) { |
| 121 var root = CommandUtil.getCommandRoot(event, rootsList); | 121 var root = CommandUtil.getCommandRoot(event, rootsList); |
| 122 | 122 |
| 123 if (root) { | 123 if (root) { |
| 124 chrome.tabs.create({url: chrome.extension.getURL('photo_import.html') + | 124 chrome.windows.create({url: chrome.extension.getURL('photo_import.html') + |
| 125 '#' + PathUtil.getRootPath(root.fullPath)}); | 125 '#' + PathUtil.getRootPath(root.fullPath), type: 'popup'}); |
| 126 } | 126 } |
| 127 }, | 127 }, |
| 128 canExecute: function(event, rootsList) { | 128 canExecute: function(event, rootsList) { |
| 129 event.canExecute = | 129 event.canExecute = |
| 130 (CommandUtil.getCommandRootType(event, rootsList) != RootType.GDATA); | 130 (CommandUtil.getCommandRootType(event, rootsList) != RootType.GDATA); |
| 131 } | 131 } |
| 132 }; | 132 }; |
| 133 | 133 |
| 134 /** | 134 /** |
| 135 * Initiates new folder creation. | 135 * Initiates new folder creation. |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 function(task) { | 237 function(task) { |
| 238 this.selection.tasks.execute(task.taskId); | 238 this.selection.tasks.execute(task.taskId); |
| 239 }.bind(fileManager)); | 239 }.bind(fileManager)); |
| 240 } | 240 } |
| 241 }, | 241 }, |
| 242 canExecute: function(event, fileManager) { | 242 canExecute: function(event, fileManager) { |
| 243 event.canExecute = fileManager.selection.tasks && | 243 event.canExecute = fileManager.selection.tasks && |
| 244 fileManager.selection.tasks.size() > 1; | 244 fileManager.selection.tasks.size() > 1; |
| 245 } | 245 } |
| 246 }; | 246 }; |
| OLD | NEW |