| 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" |
| 11 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 12 #include "chrome/browser/chromeos/drive/file_system_util.h" | 12 #include "chrome/browser/chromeos/drive/file_system_util.h" |
| 13 #include "chrome/browser/chromeos/drive/file_task_executor.h" | 13 #include "chrome/browser/chromeos/drive/file_task_executor.h" |
| 14 #include "chrome/browser/chromeos/file_manager/app_id.h" | 14 #include "chrome/browser/chromeos/file_manager/app_id.h" |
| 15 #include "chrome/browser/chromeos/file_manager/file_browser_handlers.h" | 15 #include "chrome/browser/chromeos/file_manager/file_browser_handlers.h" |
| 16 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" | 16 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" |
| 17 #include "chrome/browser/chromeos/file_manager/open_util.h" | 17 #include "chrome/browser/chromeos/file_manager/open_util.h" |
| 18 #include "chrome/browser/drive/drive_api_util.h" | 18 #include "chrome/browser/drive/drive_api_util.h" |
| 19 #include "chrome/browser/drive/drive_app_registry.h" | 19 #include "chrome/browser/drive/drive_app_registry.h" |
| 20 #include "chrome/browser/extensions/extension_tab_util.h" | 20 #include "chrome/browser/extensions/extension_tab_util.h" |
| 21 #include "chrome/browser/extensions/extension_util.h" | 21 #include "chrome/browser/extensions/extension_util.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 22 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" | 23 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" |
| 24 #include "chrome/common/extensions/api/file_browser_handlers/file_browser_handle
r.h" | 24 #include "chrome/common/extensions/api/file_browser_handlers/file_browser_handle
r.h" |
| 25 #include "chrome/common/extensions/api/file_browser_private.h" | 25 #include "chrome/common/extensions/api/file_manager_private.h" |
| 26 #include "chrome/common/extensions/extension_constants.h" | 26 #include "chrome/common/extensions/extension_constants.h" |
| 27 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
| 28 #include "extensions/browser/extension_host.h" | 28 #include "extensions/browser/extension_host.h" |
| 29 #include "extensions/browser/extension_registry.h" | 29 #include "extensions/browser/extension_registry.h" |
| 30 #include "extensions/browser/extension_system.h" | 30 #include "extensions/browser/extension_system.h" |
| 31 #include "extensions/browser/extension_util.h" | 31 #include "extensions/browser/extension_util.h" |
| 32 #include "extensions/common/constants.h" | 32 #include "extensions/common/constants.h" |
| 33 #include "extensions/common/extension_set.h" | 33 #include "extensions/common/extension_set.h" |
| 34 #include "webkit/browser/fileapi/file_system_url.h" | 34 #include "webkit/browser/fileapi/file_system_url.h" |
| 35 | 35 |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 task.action_id, | 278 task.action_id, |
| 279 file_urls, | 279 file_urls, |
| 280 done); | 280 done); |
| 281 } else if (task.task_type == TASK_TYPE_FILE_HANDLER) { | 281 } else if (task.task_type == TASK_TYPE_FILE_HANDLER) { |
| 282 std::vector<base::FilePath> paths; | 282 std::vector<base::FilePath> paths; |
| 283 for (size_t i = 0; i != file_urls.size(); ++i) | 283 for (size_t i = 0; i != file_urls.size(); ++i) |
| 284 paths.push_back(file_urls[i].path()); | 284 paths.push_back(file_urls[i].path()); |
| 285 apps::LaunchPlatformAppWithFileHandler( | 285 apps::LaunchPlatformAppWithFileHandler( |
| 286 profile, extension, task.action_id, paths); | 286 profile, extension, task.action_id, paths); |
| 287 if (!done.is_null()) | 287 if (!done.is_null()) |
| 288 done.Run(extensions::api::file_browser_private::TASK_RESULT_MESSAGE_SENT); | 288 done.Run(extensions::api::file_manager_private::TASK_RESULT_MESSAGE_SENT); |
| 289 return true; | 289 return true; |
| 290 } | 290 } |
| 291 NOTREACHED(); | 291 NOTREACHED(); |
| 292 return false; | 292 return false; |
| 293 } | 293 } |
| 294 | 294 |
| 295 void FindDriveAppTasks( | 295 void FindDriveAppTasks( |
| 296 const drive::DriveAppRegistry& drive_app_registry, | 296 const drive::DriveAppRegistry& drive_app_registry, |
| 297 const PathAndMimeTypeSet& path_mime_set, | 297 const PathAndMimeTypeSet& path_mime_set, |
| 298 std::vector<FullTaskDescriptor>* result_list) { | 298 std::vector<FullTaskDescriptor>* result_list) { |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 DCHECK(!task->is_default()); | 516 DCHECK(!task->is_default()); |
| 517 if (IsFallbackFileHandler(task->task_descriptor())) { | 517 if (IsFallbackFileHandler(task->task_descriptor())) { |
| 518 task->set_is_default(true); | 518 task->set_is_default(true); |
| 519 return; | 519 return; |
| 520 } | 520 } |
| 521 } | 521 } |
| 522 } | 522 } |
| 523 | 523 |
| 524 } // namespace file_tasks | 524 } // namespace file_tasks |
| 525 } // namespace file_manager | 525 } // namespace file_manager |
| OLD | NEW |