| 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 /** | 5 /** |
| 6 * FileManager constructor. | 6 * FileManager constructor. |
| 7 * | 7 * |
| 8 * FileManager objects encapsulate the functionality of the file selector | 8 * FileManager objects encapsulate the functionality of the file selector |
| 9 * dialogs, as well as the full screen file manager application (though the | 9 * dialogs, as well as the full screen file manager application (though the |
| 10 * latter is not yet implemented). | 10 * latter is not yet implemented). |
| (...skipping 2512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2523 // TODO(serya): This hack needed until task.iconUrl is working | 2523 // TODO(serya): This hack needed until task.iconUrl is working |
| 2524 // (see GetFileTasksFileBrowserFunction::RunImpl). | 2524 // (see GetFileTasksFileBrowserFunction::RunImpl). |
| 2525 task.iconUrl = | 2525 task.iconUrl = |
| 2526 chrome.extension.getURL('images/filetype_audio.png'); | 2526 chrome.extension.getURL('images/filetype_audio.png'); |
| 2527 task.title = str('ACTION_LISTEN'); | 2527 task.title = str('ACTION_LISTEN'); |
| 2528 } else if (task_parts[1] == 'mount-archive') { | 2528 } else if (task_parts[1] == 'mount-archive') { |
| 2529 task.iconUrl = | 2529 task.iconUrl = |
| 2530 chrome.extension.getURL('images/filetype_archive.png'); | 2530 chrome.extension.getURL('images/filetype_archive.png'); |
| 2531 task.title = str('MOUNT_ARCHIVE'); | 2531 task.title = str('MOUNT_ARCHIVE'); |
| 2532 } else if (task_parts[1] == 'gallery') { | 2532 } else if (task_parts[1] == 'gallery') { |
| 2533 // If a single video is selected the Gallery is redundant. | |
| 2534 if (selection.urls.length == 1 && FileType.isVideo(selection.urls[0])) | |
| 2535 continue; | |
| 2536 task.title = str('ACTION_OPEN'); | 2533 task.title = str('ACTION_OPEN'); |
| 2537 task.iconUrl = | 2534 task.iconUrl = |
| 2538 chrome.extension.getURL('images/filetype_image.png'); | 2535 chrome.extension.getURL('images/filetype_image.png'); |
| 2539 } else if (task_parts[1] == 'watch') { | 2536 } else if (task_parts[1] == 'watch') { |
| 2540 // Hide "Watch" action for multiple selection. | |
| 2541 if (selection.urls.length > 1) | |
| 2542 continue; | |
| 2543 task.iconUrl = | 2537 task.iconUrl = |
| 2544 chrome.extension.getURL('images/filetype_video.png'); | 2538 chrome.extension.getURL('images/filetype_video.png'); |
| 2545 task.title = str('ACTION_WATCH'); | 2539 task.title = str('ACTION_WATCH'); |
| 2546 } else if (task_parts[1] == 'open-hosted') { | 2540 } else if (task_parts[1] == 'open-hosted') { |
| 2547 if (selection.urls.length > 1) { | 2541 if (selection.urls.length > 1) { |
| 2548 task.iconUrl = | 2542 task.iconUrl = |
| 2549 chrome.extension.getURL('images/filetype_generic.png'); | 2543 chrome.extension.getURL('images/filetype_generic.png'); |
| 2550 } else { | 2544 } else { |
| 2551 // Use specific icon. | 2545 // Use specific icon. |
| 2552 var icon = FileType.getIcon(selection.urls[0]); | 2546 var icon = FileType.getIcon(selection.urls[0]); |
| (...skipping 2033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4586 function closeBanner() { | 4580 function closeBanner() { |
| 4587 self.cleanupGDataWelcome_(); | 4581 self.cleanupGDataWelcome_(); |
| 4588 // Stop showing the welcome banner. | 4582 // Stop showing the welcome banner. |
| 4589 localStorage[WELCOME_HEADER_COUNTER_KEY] = WELCOME_HEADER_COUNTER_LIMIT; | 4583 localStorage[WELCOME_HEADER_COUNTER_KEY] = WELCOME_HEADER_COUNTER_LIMIT; |
| 4590 } | 4584 } |
| 4591 | 4585 |
| 4592 return maybeShowBanner; | 4586 return maybeShowBanner; |
| 4593 }; | 4587 }; |
| 4594 })(); | 4588 })(); |
| 4595 | 4589 |
| OLD | NEW |