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 #include "chrome/browser/chromeos/file_manager/file_tasks.h" | 5 #include "chrome/browser/chromeos/file_manager/file_tasks.h" |
6 | 6 |
7 #include "apps/launcher.h" | 7 #include "apps/launcher.h" |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // Both "watch" and "gallery-video" actions are applicable which means that the | 131 // Both "watch" and "gallery-video" actions are applicable which means that the |
132 // selection is all videos. Showing them both is confusing, so we only keep | 132 // selection is all videos. Showing them both is confusing, so we only keep |
133 // the one that makes more sense ("watch" for single selection, "gallery" | 133 // the one that makes more sense ("watch" for single selection, "gallery" |
134 // for multiple selection). | 134 // for multiple selection). |
135 void ChooseSuitableVideoHandler( | 135 void ChooseSuitableVideoHandler( |
136 const std::vector<GURL>& file_urls, | 136 const std::vector<GURL>& file_urls, |
137 std::vector<FullTaskDescriptor>* task_list) { | 137 std::vector<FullTaskDescriptor>* task_list) { |
138 std::vector<FullTaskDescriptor>::iterator video_player_iter = | 138 std::vector<FullTaskDescriptor>::iterator video_player_iter = |
139 FindTaskForAppIdAndActionId(task_list, kVideoPlayerAppId, "video"); | 139 FindTaskForAppIdAndActionId(task_list, kVideoPlayerAppId, "video"); |
140 std::vector<FullTaskDescriptor>::iterator gallery_video_iter = | 140 std::vector<FullTaskDescriptor>::iterator gallery_video_iter = |
141 FindTaskForAppIdAndActionId( | 141 FindTaskForAppIdAndActionId(task_list, kGalleryAppId, "open"); |
142 task_list, kFileManagerAppId, "gallery-video"); | |
143 | 142 |
144 if (video_player_iter != task_list->end() && | 143 if (video_player_iter != task_list->end() && |
145 gallery_video_iter != task_list->end()) { | 144 gallery_video_iter != task_list->end()) { |
146 if (file_urls.size() == 1) | 145 if (file_urls.size() == 1) |
147 task_list->erase(gallery_video_iter); | 146 task_list->erase(gallery_video_iter); |
148 else | 147 else |
149 task_list->erase(video_player_iter); | 148 task_list->erase(video_player_iter); |
150 } | 149 } |
151 } | 150 } |
152 | 151 |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 if (file_browser_handlers::IsFallbackFileBrowserHandler( | 548 if (file_browser_handlers::IsFallbackFileBrowserHandler( |
550 task->task_descriptor())) { | 549 task->task_descriptor())) { |
551 task->set_is_default(true); | 550 task->set_is_default(true); |
552 return; | 551 return; |
553 } | 552 } |
554 } | 553 } |
555 } | 554 } |
556 | 555 |
557 } // namespace file_tasks | 556 } // namespace file_tasks |
558 } // namespace file_manager | 557 } // namespace file_manager |
OLD | NEW |