diff options
author | hirono@chromium.org <hirono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-16 08:49:32 +0000 |
---|---|---|
committer | hirono@chromium.org <hirono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-06-16 08:49:32 +0000 |
commit | 465a6c9b499849181f7538bd5e9847d4a2479bd7 (patch) | |
tree | 7ee1616f73ef8cec6356d18daadd7a738ed3111c | |
parent | cdd5491a7f80ac170189792d19a6f0e385ef5250 (diff) | |
download | chromium_src-465a6c9b499849181f7538bd5e9847d4a2479bd7.zip chromium_src-465a6c9b499849181f7538bd5e9847d4a2479bd7.tar.gz chromium_src-465a6c9b499849181f7538bd5e9847d4a2479bd7.tar.bz2 |
Files.app: Stop video support in the gallery.
We have the separated video player, and we don't need to play videos in the
gallery.
BUG=251702
TEST=None
Review URL: https://codereview.chromium.org/337893005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@277388 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/file_manager/file_tasks.cc | 53 | ||||
-rw-r--r-- | ui/file_manager/file_manager/manifest.json | 22 | ||||
-rw-r--r-- | ui/file_manager/gallery/manifest.json | 21 |
3 files changed, 3 insertions, 93 deletions
diff --git a/chrome/browser/chromeos/file_manager/file_tasks.cc b/chrome/browser/chromeos/file_manager/file_tasks.cc index 1733bd3..b13cc07 100644 --- a/chrome/browser/chromeos/file_manager/file_tasks.cc +++ b/chrome/browser/chromeos/file_manager/file_tasks.cc @@ -108,25 +108,6 @@ void KeepOnlyFileManagerInternalTasks(std::vector<FullTaskDescriptor>* tasks) { tasks->swap(filtered); } -// Finds a task that matches |app_id| and |action_id| from |task_list|. -// Returns a mutable iterator to the handler if found. Returns task_list->end() -// if not found. -std::vector<FullTaskDescriptor>::iterator -FindTaskForAppIdAndActionId( - std::vector<FullTaskDescriptor>* task_list, - const std::string& app_id, - const std::string& action_id) { - DCHECK(task_list); - - std::vector<FullTaskDescriptor>::iterator iter = task_list->begin(); - while (iter != task_list->end() && - !(iter->task_descriptor().app_id == app_id && - iter->task_descriptor().action_id == action_id)) { - ++iter; - } - return iter; -} - void ChooseSuitableGalleryHandler(std::vector<FullTaskDescriptor>* task_list) { const bool disable_new_gallery = base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( @@ -140,8 +121,7 @@ void ChooseSuitableGalleryHandler(std::vector<FullTaskDescriptor>* task_list) { ++it; } else { if (it->task_descriptor().app_id == kFileManagerAppId && - (it->task_descriptor().action_id == "gallery" || - it->task_descriptor().action_id == "gallery-video")) { + it->task_descriptor().action_id == "gallery") { it = task_list->erase(it); } else { ++it; @@ -150,35 +130,6 @@ void ChooseSuitableGalleryHandler(std::vector<FullTaskDescriptor>* task_list) { } } -// Chooses a suitable video handeler and removes other internal video hander. -// Both "watch" and "gallery-video" actions are applicable which means that the -// selection is all videos. Showing them both is confusing, so we only keep -// the one that makes more sense ("watch" for single selection, "gallery" -// for multiple selection). -void ChooseSuitableVideoHandler( - const std::vector<GURL>& file_urls, - std::vector<FullTaskDescriptor>* task_list) { - std::vector<FullTaskDescriptor>::iterator video_player_iter = - FindTaskForAppIdAndActionId(task_list, kVideoPlayerAppId, "video"); - std::vector<FullTaskDescriptor>::iterator gallery_video_iter; - if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( - chromeos::switches::kFileManagerEnableNewGallery) == "false") { - gallery_video_iter = FindTaskForAppIdAndActionId( - task_list, kFileManagerAppId, "gallery-video"); - } else { - gallery_video_iter = - FindTaskForAppIdAndActionId(task_list, kGalleryAppId, "open"); - } - - if (video_player_iter != task_list->end() && - gallery_video_iter != task_list->end()) { - if (file_urls.size() == 1) - task_list->erase(gallery_video_iter); - else - task_list->erase(video_player_iter); - } -} - } // namespace FullTaskDescriptor::FullTaskDescriptor( @@ -540,8 +491,6 @@ void FindAllTypesOfTasks( KeepOnlyFileManagerInternalTasks(result_list); ChooseSuitableGalleryHandler(result_list); - ChooseSuitableVideoHandler(file_urls, result_list); - ChooseAndSetDefaultTask(*profile->GetPrefs(), path_mime_set, result_list); } diff --git a/ui/file_manager/file_manager/manifest.json b/ui/file_manager/file_manager/manifest.json index cc6f571..edba2c5 100644 --- a/ui/file_manager/file_manager/manifest.json +++ b/ui/file_manager/file_manager/manifest.json @@ -110,28 +110,6 @@ ] }, { - "id": "gallery-video", - "default_title": "__MSG_OPEN_ACTION__", - "default_icon": "common/images/file_types/200/image.png", - "file_filters": [ - // Video formats - "filesystem:*.3gp", - "filesystem:*.avi", - "filesystem:*.m4v", - "filesystem:*.mkv", - "filesystem:*.mov", - "filesystem:*.mp4", - "filesystem:*.mpeg", - "filesystem:*.mpeg4", - "filesystem:*.mpg", - "filesystem:*.mpg4", - "filesystem:*.ogm", - "filesystem:*.ogv", - "filesystem:*.ogx", - "filesystem:*.webm" - ] - }, - { "id": "open-hosted-generic", "default_title": "__MSG_HOSTED__", "default_icon": "common/images/file_types/200generic.png", diff --git a/ui/file_manager/gallery/manifest.json b/ui/file_manager/gallery/manifest.json index 94b03a9..46044b7 100644 --- a/ui/file_manager/gallery/manifest.json +++ b/ui/file_manager/gallery/manifest.json @@ -32,33 +32,16 @@ "file_handlers": { "open": { "types": [ - "image/*", - "video/*" + "image/*" ], "extensions": [ - // images "bmp", "gif", "ico", "jpg", "jpeg", "png", - "webp", - // videos - "3gp", - "avi", - "m4v", - "mkv", - "mov", - "mp4", - "mpeg", - "mpeg4", - "mpg", - "mpg4", - "ogm", - "ogv", - "ogx", - "webm" + "webp" ], // TODO(hirono): Rename and localize this. "title": "Open" |