| 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_manager/file_browser_private_a
pi.h" | 5 #include "chrome/browser/chromeos/extensions/file_manager/file_browser_private_a
pi.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chromeos/extensions/file_manager/event_router.h" | 7 #include "chrome/browser/chromeos/extensions/file_manager/event_router.h" |
| 8 #include "chrome/browser/chromeos/extensions/file_manager/file_browser_private_a
pi_factory.h" | 8 #include "chrome/browser/chromeos/extensions/file_manager/file_browser_private_a
pi_factory.h" |
| 9 #include "chrome/browser/chromeos/extensions/file_manager/private_api_dialog.h" | 9 #include "chrome/browser/chromeos/extensions/file_manager/private_api_dialog.h" |
| 10 #include "chrome/browser/chromeos/extensions/file_manager/private_api_drive.h" | 10 #include "chrome/browser/chromeos/extensions/file_manager/private_api_drive.h" |
| 11 #include "chrome/browser/chromeos/extensions/file_manager/private_api_file_syste
m.h" | 11 #include "chrome/browser/chromeos/extensions/file_manager/private_api_file_syste
m.h" |
| 12 #include "chrome/browser/chromeos/extensions/file_manager/private_api_misc.h" | 12 #include "chrome/browser/chromeos/extensions/file_manager/private_api_misc.h" |
| 13 #include "chrome/browser/chromeos/extensions/file_manager/private_api_mount.h" | 13 #include "chrome/browser/chromeos/extensions/file_manager/private_api_mount.h" |
| 14 #include "chrome/browser/chromeos/extensions/file_manager/private_api_strings.h" | 14 #include "chrome/browser/chromeos/extensions/file_manager/private_api_strings.h" |
| 15 #include "chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h" | 15 #include "chrome/browser/chromeos/extensions/file_manager/private_api_tasks.h" |
| 16 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" | 16 #include "chrome/browser/chromeos/extensions/file_manager/private_api_util.h" |
| 17 #include "chrome/browser/extensions/extension_function_registry.h" | 17 #include "chrome/browser/extensions/extension_function_registry.h" |
| 18 | 18 |
| 19 namespace file_manager { | 19 namespace file_manager { |
| 20 | 20 |
| 21 FileBrowserPrivateAPI::FileBrowserPrivateAPI(Profile* profile) | 21 FileBrowserPrivateAPI::FileBrowserPrivateAPI(Profile* profile) |
| 22 : event_router_(new EventRouter(profile)) { | 22 : event_router_(new EventRouter(profile)) { |
| 23 ExtensionFunctionRegistry* registry = | 23 ExtensionFunctionRegistry* registry = |
| 24 ExtensionFunctionRegistry::GetInstance(); | 24 ExtensionFunctionRegistry::GetInstance(); |
| 25 // Tasks related functions. | 25 // Tasks related functions. |
| 26 registry->RegisterFunction<ExecuteTaskFunction>(); | 26 registry->RegisterFunction<extensions::ExecuteTaskFunction>(); |
| 27 registry->RegisterFunction<GetFileTasksFunction>(); | 27 registry->RegisterFunction<extensions::GetFileTasksFunction>(); |
| 28 registry->RegisterFunction<SetDefaultTaskFunction>(); | 28 registry->RegisterFunction<extensions::SetDefaultTaskFunction>(); |
| 29 | 29 |
| 30 // Drive related functions. | 30 // Drive related functions. |
| 31 registry->RegisterFunction<GetDriveEntryPropertiesFunction>(); | 31 registry->RegisterFunction<extensions::GetDriveEntryPropertiesFunction>(); |
| 32 registry->RegisterFunction<PinDriveFileFunction>(); | 32 registry->RegisterFunction<extensions::PinDriveFileFunction>(); |
| 33 registry->RegisterFunction<GetDriveFilesFunction>(); | 33 registry->RegisterFunction<extensions::GetDriveFilesFunction>(); |
| 34 registry->RegisterFunction<CancelFileTransfersFunction>(); | 34 registry->RegisterFunction<extensions::CancelFileTransfersFunction>(); |
| 35 registry->RegisterFunction<SearchDriveFunction>(); | 35 registry->RegisterFunction<extensions::SearchDriveFunction>(); |
| 36 registry->RegisterFunction<SearchDriveMetadataFunction>(); | 36 registry->RegisterFunction<extensions::SearchDriveMetadataFunction>(); |
| 37 registry->RegisterFunction<ClearDriveCacheFunction>(); | 37 registry->RegisterFunction<extensions::ClearDriveCacheFunction>(); |
| 38 registry->RegisterFunction<GetDriveConnectionStateFunction>(); | 38 registry->RegisterFunction<extensions::GetDriveConnectionStateFunction>(); |
| 39 registry->RegisterFunction<RequestAccessTokenFunction>(); | 39 registry->RegisterFunction<extensions::RequestAccessTokenFunction>(); |
| 40 registry->RegisterFunction<GetShareUrlFunction>(); | 40 registry->RegisterFunction<extensions::GetShareUrlFunction>(); |
| 41 | 41 |
| 42 // Select file dialog related functions. | 42 // Select file dialog related functions. |
| 43 registry->RegisterFunction<CancelFileDialogFunction>(); | 43 registry->RegisterFunction<extensions::CancelFileDialogFunction>(); |
| 44 registry->RegisterFunction<SelectFileFunction>(); | 44 registry->RegisterFunction<extensions::SelectFileFunction>(); |
| 45 registry->RegisterFunction<SelectFilesFunction>(); | 45 registry->RegisterFunction<extensions::SelectFilesFunction>(); |
| 46 | 46 |
| 47 // Mount points related functions. | 47 // Mount points related functions. |
| 48 registry->RegisterFunction<AddMountFunction>(); | 48 registry->RegisterFunction<extensions::AddMountFunction>(); |
| 49 registry->RegisterFunction<RemoveMountFunction>(); | 49 registry->RegisterFunction<extensions::RemoveMountFunction>(); |
| 50 registry->RegisterFunction<GetMountPointsFunction>(); | 50 registry->RegisterFunction<extensions::GetMountPointsFunction>(); |
| 51 | 51 |
| 52 // Hundreds of strings for the file manager. | 52 // Hundreds of strings for the file manager. |
| 53 registry->RegisterFunction<GetStringsFunction>(); | 53 registry->RegisterFunction<extensions::GetStringsFunction>(); |
| 54 | 54 |
| 55 // File system related functions. | 55 // File system related functions. |
| 56 registry->RegisterFunction<RequestFileSystemFunction>(); | 56 registry->RegisterFunction<extensions::RequestFileSystemFunction>(); |
| 57 registry->RegisterFunction<AddFileWatchFunction>(); | 57 registry->RegisterFunction<extensions::AddFileWatchFunction>(); |
| 58 registry->RegisterFunction<RemoveFileWatchFunction>(); | 58 registry->RegisterFunction<extensions::RemoveFileWatchFunction>(); |
| 59 registry->RegisterFunction<SetLastModifiedFunction>(); | 59 registry->RegisterFunction<extensions::SetLastModifiedFunction>(); |
| 60 registry->RegisterFunction<GetSizeStatsFunction>(); | 60 registry->RegisterFunction<extensions::GetSizeStatsFunction>(); |
| 61 registry->RegisterFunction<GetVolumeMetadataFunction>(); | 61 registry->RegisterFunction<extensions::GetVolumeMetadataFunction>(); |
| 62 registry->RegisterFunction<ValidatePathNameLengthFunction>(); | 62 registry->RegisterFunction<extensions::ValidatePathNameLengthFunction>(); |
| 63 registry->RegisterFunction<FormatDeviceFunction>(); | 63 registry->RegisterFunction<extensions::FormatDeviceFunction>(); |
| 64 | 64 |
| 65 // Miscellaneous functions. | 65 // Miscellaneous functions. |
| 66 registry->RegisterFunction<LogoutUserFunction>(); | 66 registry->RegisterFunction<extensions::LogoutUserFunction>(); |
| 67 registry->RegisterFunction<GetPreferencesFunction>(); | 67 registry->RegisterFunction<extensions::GetPreferencesFunction>(); |
| 68 registry->RegisterFunction<SetPreferencesFunction>(); | 68 registry->RegisterFunction<extensions::SetPreferencesFunction>(); |
| 69 registry->RegisterFunction<ZipSelectionFunction>(); | 69 registry->RegisterFunction<extensions::ZipSelectionFunction>(); |
| 70 registry->RegisterFunction<ZoomFunction>(); | 70 registry->RegisterFunction<extensions::ZoomFunction>(); |
| 71 event_router_->ObserveFileSystemEvents(); | 71 event_router_->ObserveFileSystemEvents(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 FileBrowserPrivateAPI::~FileBrowserPrivateAPI() { | 74 FileBrowserPrivateAPI::~FileBrowserPrivateAPI() { |
| 75 } | 75 } |
| 76 | 76 |
| 77 void FileBrowserPrivateAPI::Shutdown() { | 77 void FileBrowserPrivateAPI::Shutdown() { |
| 78 event_router_->Shutdown(); | 78 event_router_->Shutdown(); |
| 79 } | 79 } |
| 80 | 80 |
| 81 // static | 81 // static |
| 82 FileBrowserPrivateAPI* FileBrowserPrivateAPI::Get(Profile* profile) { | 82 FileBrowserPrivateAPI* FileBrowserPrivateAPI::Get(Profile* profile) { |
| 83 return FileBrowserPrivateAPIFactory::GetForProfile(profile); | 83 return FileBrowserPrivateAPIFactory::GetForProfile(profile); |
| 84 } | 84 } |
| 85 | 85 |
| 86 } // namespace file_manager | 86 } // namespace file_manager |
| OLD | NEW |