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 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 * Clears gdata cache. | 209 * Clears gdata cache. |
210 */ | 210 */ |
211 Commands.gdataClearCacheCommand = { | 211 Commands.gdataClearCacheCommand = { |
212 execute: function() { | 212 execute: function() { |
213 chrome.fileBrowserPrivate.clearDriveCache(); | 213 chrome.fileBrowserPrivate.clearDriveCache(); |
214 }, | 214 }, |
215 canExecute: CommandUtil.canExecuteOnGDataOnly | 215 canExecute: CommandUtil.canExecuteOnGDataOnly |
216 }; | 216 }; |
217 | 217 |
218 /** | 218 /** |
| 219 * Opens drive.google.com. |
| 220 */ |
| 221 Commands.gdataGoToDriveCommand = { |
| 222 execute: function() { |
| 223 window.open(FileManager.GOOGLE_DRIVE_ROOT, 'gdata-root'); |
| 224 }, |
| 225 canExecute: CommandUtil.canExecuteOnGDataOnly |
| 226 }; |
| 227 |
| 228 /** |
219 * Displays open with dialog for current selection. | 229 * Displays open with dialog for current selection. |
220 */ | 230 */ |
221 Commands.openWithCommand = { | 231 Commands.openWithCommand = { |
222 execute: function(event, fileManager) { | 232 execute: function(event, fileManager) { |
223 if (fileManager.selection.tasks) { | 233 if (fileManager.selection.tasks) { |
224 fileManager.selection.tasks.showTaskPicker(fileManager.defaultTaskPicker, | 234 fileManager.selection.tasks.showTaskPicker(fileManager.defaultTaskPicker, |
225 str('OPEN_WITH_BUTTON_LABEL'), | 235 str('OPEN_WITH_BUTTON_LABEL'), |
226 null, | 236 null, |
227 function(task) { | 237 function(task) { |
228 this.selection.tasks.execute(task.taskId); | 238 this.selection.tasks.execute(task.taskId); |
229 }.bind(fileManager)); | 239 }.bind(fileManager)); |
230 } | 240 } |
231 }, | 241 }, |
232 canExecute: function(event, fileManager) { | 242 canExecute: function(event, fileManager) { |
233 event.canExecute = fileManager.selection.tasks && | 243 event.canExecute = fileManager.selection.tasks && |
234 fileManager.selection.tasks.size() > 1; | 244 fileManager.selection.tasks.size() > 1; |
235 } | 245 } |
236 }; | 246 }; |
OLD | NEW |