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/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 | 304 |
305 // Execute the task. | 305 // Execute the task. |
306 if (task.task_type == TASK_TYPE_FILE_BROWSER_HANDLER) { | 306 if (task.task_type == TASK_TYPE_FILE_BROWSER_HANDLER) { |
307 return file_browser_handlers::ExecuteFileBrowserHandler( | 307 return file_browser_handlers::ExecuteFileBrowserHandler( |
308 profile, | 308 profile, |
309 extension, | 309 extension, |
310 task.action_id, | 310 task.action_id, |
311 file_urls, | 311 file_urls, |
312 done); | 312 done); |
313 } else if (task.task_type == TASK_TYPE_FILE_HANDLER) { | 313 } else if (task.task_type == TASK_TYPE_FILE_HANDLER) { |
| 314 std::vector<base::FilePath> paths; |
314 for (size_t i = 0; i != file_urls.size(); ++i) { | 315 for (size_t i = 0; i != file_urls.size(); ++i) { |
315 apps::LaunchPlatformAppWithFileHandler( | 316 paths.push_back(file_urls[i].path()); |
316 profile, extension, task.action_id, file_urls[i].path()); | |
317 } | 317 } |
318 | 318 apps::LaunchPlatformAppWithFileHandler( |
| 319 profile, extension, task.action_id, paths); |
319 if (!done.is_null()) | 320 if (!done.is_null()) |
320 done.Run(extensions::api::file_browser_private::TASK_RESULT_MESSAGE_SENT); | 321 done.Run(extensions::api::file_browser_private::TASK_RESULT_MESSAGE_SENT); |
321 return true; | 322 return true; |
322 } | 323 } |
323 NOTREACHED(); | 324 NOTREACHED(); |
324 return false; | 325 return false; |
325 } | 326 } |
326 | 327 |
327 void FindDriveAppTasks( | 328 void FindDriveAppTasks( |
328 const drive::DriveAppRegistry& drive_app_registry, | 329 const drive::DriveAppRegistry& drive_app_registry, |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 if (file_browser_handlers::IsFallbackFileBrowserHandler( | 551 if (file_browser_handlers::IsFallbackFileBrowserHandler( |
551 task->task_descriptor())) { | 552 task->task_descriptor())) { |
552 task->set_is_default(true); | 553 task->set_is_default(true); |
553 return; | 554 return; |
554 } | 555 } |
555 } | 556 } |
556 } | 557 } |
557 | 558 |
558 } // namespace file_tasks | 559 } // namespace file_tasks |
559 } // namespace file_manager | 560 } // namespace file_manager |
OLD | NEW |