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/extensions/file_browser_private_api.h" | 5 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h" |
6 | 6 |
7 #include <sys/stat.h> | 7 #include <sys/stat.h> |
8 #include <sys/statvfs.h> | 8 #include <sys/statvfs.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #include <utime.h> | 10 #include <utime.h> |
(...skipping 21 matching lines...) Expand all Loading... |
32 #include "chrome/browser/chromeos/drive/drive_system_service.h" | 32 #include "chrome/browser/chromeos/drive/drive_system_service.h" |
33 #include "chrome/browser/chromeos/drive/drive_webapps_registry.h" | 33 #include "chrome/browser/chromeos/drive/drive_webapps_registry.h" |
34 #include "chrome/browser/chromeos/extensions/file_handler_util.h" | 34 #include "chrome/browser/chromeos/extensions/file_handler_util.h" |
35 #include "chrome/browser/chromeos/extensions/file_manager_util.h" | 35 #include "chrome/browser/chromeos/extensions/file_manager_util.h" |
36 #include "chrome/browser/chromeos/extensions/zip_file_creator.h" | 36 #include "chrome/browser/chromeos/extensions/zip_file_creator.h" |
37 #include "chrome/browser/chromeos/system/statistics_provider.h" | 37 #include "chrome/browser/chromeos/system/statistics_provider.h" |
38 #include "chrome/browser/extensions/app_file_handler_util.h" | 38 #include "chrome/browser/extensions/app_file_handler_util.h" |
39 #include "chrome/browser/extensions/extension_function_dispatcher.h" | 39 #include "chrome/browser/extensions/extension_function_dispatcher.h" |
40 #include "chrome/browser/extensions/extension_process_manager.h" | 40 #include "chrome/browser/extensions/extension_process_manager.h" |
41 #include "chrome/browser/extensions/extension_service.h" | 41 #include "chrome/browser/extensions/extension_service.h" |
| 42 #include "chrome/browser/extensions/extension_system.h" |
42 #include "chrome/browser/extensions/extension_tab_util.h" | 43 #include "chrome/browser/extensions/extension_tab_util.h" |
43 #include "chrome/browser/extensions/process_map.h" | 44 #include "chrome/browser/extensions/process_map.h" |
44 #include "chrome/browser/google_apis/drive_service_interface.h" | 45 #include "chrome/browser/google_apis/drive_service_interface.h" |
45 #include "chrome/browser/google_apis/gdata_wapi_parser.h" | 46 #include "chrome/browser/google_apis/gdata_wapi_parser.h" |
46 #include "chrome/browser/google_apis/operation_registry.h" | 47 #include "chrome/browser/google_apis/operation_registry.h" |
47 #include "chrome/browser/google_apis/time_util.h" | 48 #include "chrome/browser/google_apis/time_util.h" |
48 #include "chrome/browser/intents/web_intents_util.h" | 49 #include "chrome/browser/intents/web_intents_util.h" |
49 #include "chrome/browser/profiles/profile.h" | 50 #include "chrome/browser/profiles/profile.h" |
50 #include "chrome/browser/ui/browser.h" | 51 #include "chrome/browser/ui/browser.h" |
51 #include "chrome/browser/ui/browser_window.h" | 52 #include "chrome/browser/ui/browser_window.h" |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
955 // the extension tasks to the Drive task list. We know there aren't duplicates | 956 // the extension tasks to the Drive task list. We know there aren't duplicates |
956 // because they're entirely different kinds of tasks, but there could be both | 957 // because they're entirely different kinds of tasks, but there could be both |
957 // kinds of tasks for a file type (an image file, for instance). | 958 // kinds of tasks for a file type (an image file, for instance). |
958 std::set<const FileBrowserHandler*> common_tasks; | 959 std::set<const FileBrowserHandler*> common_tasks; |
959 std::set<const FileBrowserHandler*> default_tasks; | 960 std::set<const FileBrowserHandler*> default_tasks; |
960 if (!file_handler_util::FindCommonTasks(profile_, file_urls, &common_tasks)) | 961 if (!file_handler_util::FindCommonTasks(profile_, file_urls, &common_tasks)) |
961 return false; | 962 return false; |
962 file_handler_util::FindDefaultTasks(profile_, file_urls, | 963 file_handler_util::FindDefaultTasks(profile_, file_urls, |
963 common_tasks, &default_tasks); | 964 common_tasks, &default_tasks); |
964 | 965 |
965 ExtensionService* service = profile_->GetExtensionService(); | 966 ExtensionService* service = |
| 967 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
966 for (std::set<const FileBrowserHandler*>::const_iterator iter = | 968 for (std::set<const FileBrowserHandler*>::const_iterator iter = |
967 common_tasks.begin(); | 969 common_tasks.begin(); |
968 iter != common_tasks.end(); | 970 iter != common_tasks.end(); |
969 ++iter) { | 971 ++iter) { |
970 const FileBrowserHandler* handler = *iter; | 972 const FileBrowserHandler* handler = *iter; |
971 const std::string extension_id = handler->extension_id(); | 973 const std::string extension_id = handler->extension_id(); |
972 const Extension* extension = service->GetExtensionById(extension_id, false); | 974 const Extension* extension = service->GetExtensionById(extension_id, false); |
973 CHECK(extension); | 975 CHECK(extension); |
974 DictionaryValue* task = new DictionaryValue; | 976 DictionaryValue* task = new DictionaryValue; |
975 task->SetString("taskId", file_handler_util::MakeTaskID( | 977 task->SetString("taskId", file_handler_util::MakeTaskID( |
(...skipping 1938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2914 // Keep the refcount until the zipping is complete on utility process. | 2916 // Keep the refcount until the zipping is complete on utility process. |
2915 AddRef(); | 2917 AddRef(); |
2916 return true; | 2918 return true; |
2917 } | 2919 } |
2918 | 2920 |
2919 void ZipSelectionFunction::OnZipDone(bool success) { | 2921 void ZipSelectionFunction::OnZipDone(bool success) { |
2920 SetResult(new base::FundamentalValue(success)); | 2922 SetResult(new base::FundamentalValue(success)); |
2921 SendResponse(true); | 2923 SendResponse(true); |
2922 Release(); | 2924 Release(); |
2923 } | 2925 } |
OLD | NEW |