diff options
author | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 07:14:47 +0000 |
---|---|---|
committer | hashimoto@chromium.org <hashimoto@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-08 07:14:47 +0000 |
commit | 583b4fc28d0dabb780105f8c68840edd0280523e (patch) | |
tree | 16dd4bf25dff8c353252e9485a5f9285765b5684 | |
parent | e7d5d9c69d1634ca71fd9ff6f1e27b6fa0b47afc (diff) | |
download | chromium_src-583b4fc28d0dabb780105f8c68840edd0280523e.zip chromium_src-583b4fc28d0dabb780105f8c68840edd0280523e.tar.gz chromium_src-583b4fc28d0dabb780105f8c68840edd0280523e.tar.bz2 |
Remove chromeos::GDataFileSystem::GetOperationRegistry()
BUG=131505
TEST=unit_tests --gtest_filter="GData*"
Review URL: https://chromiumcodereview.appspot.com/10533042
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141182 0039d316-1c4b-4281-b951-d872f2087c98
8 files changed, 37 insertions, 37 deletions
diff --git a/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc b/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc index 10f6d97..edcde56 100644 --- a/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc +++ b/chrome/browser/chromeos/extensions/external_filesystem_apitest.cc @@ -12,11 +12,11 @@ #include "base/scoped_temp_dir.h" #include "base/threading/worker_pool.h" #include "base/values.h" -#include "chrome/common/chrome_paths.h" +#include "chrome/browser/chromeos/gdata/gdata_errorcode.h" #include "chrome/browser/chromeos/gdata/gdata_file_system.h" -#include "chrome/browser/chromeos/gdata/gdata_system_service.h" +#include "chrome/browser/chromeos/gdata/gdata_operation_registry.h" #include "chrome/browser/chromeos/gdata/gdata_parser.h" -#include "chrome/browser/chromeos/gdata/gdata_errorcode.h" +#include "chrome/browser/chromeos/gdata/gdata_system_service.h" #include "chrome/browser/chromeos/gdata/gdata_util.h" #include "chrome/browser/chromeos/gdata/mock_gdata_documents_service.h" #include "chrome/browser/extensions/extension_apitest.h" @@ -24,6 +24,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/browser.h" #include "chrome/common/chrome_notification_types.h" +#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/test/base/ui_test_utils.h" #include "content/public/browser/notification_service.h" diff --git a/chrome/browser/chromeos/extensions/file_browser_event_router.cc b/chrome/browser/chromeos/extensions/file_browser_event_router.cc index 1bbf6cc..f70fdac 100644 --- a/chrome/browser/chromeos/extensions/file_browser_event_router.cc +++ b/chrome/browser/chromeos/extensions/file_browser_event_router.cc @@ -12,6 +12,7 @@ #include "chrome/browser/chromeos/cros/cros_library.h" #include "chrome/browser/chromeos/extensions/file_browser_notifications.h" #include "chrome/browser/chromeos/extensions/file_manager_util.h" +#include "chrome/browser/chromeos/gdata/gdata_documents_service.h" #include "chrome/browser/chromeos/gdata/gdata_system_service.h" #include "chrome/browser/chromeos/gdata/gdata_util.h" #include "chrome/browser/chromeos/login/base_login_display_host.h" @@ -116,8 +117,7 @@ void FileBrowserEventRouter::ShutdownOnUIThread() { GDataSystemServiceFactory::FindForProfile(profile_); if (system_service) { system_service->file_system()->RemoveObserver(this); - system_service->file_system()->GetOperationRegistry()-> - RemoveObserver(this); + system_service->docs_service()->operation_registry()->RemoveObserver(this); } chromeos::NetworkLibrary* network_library = @@ -147,7 +147,7 @@ void FileBrowserEventRouter::ObserveFileSystemEvents() { NOTREACHED(); return; } - system_service->file_system()->GetOperationRegistry()->AddObserver(this); + system_service->docs_service()->operation_registry()->AddObserver(this); system_service->file_system()->AddObserver(this); chromeos::NetworkLibrary* network_library = diff --git a/chrome/browser/chromeos/extensions/file_browser_private_api.cc b/chrome/browser/chromeos/extensions/file_browser_private_api.cc index 6f12f34..2df1c52 100644 --- a/chrome/browser/chromeos/extensions/file_browser_private_api.cc +++ b/chrome/browser/chromeos/extensions/file_browser_private_api.cc @@ -22,6 +22,7 @@ #include "chrome/browser/chromeos/extensions/file_manager_util.h" #include "chrome/browser/chromeos/gdata/drive_webapps_registry.h" #include "chrome/browser/chromeos/gdata/gdata.pb.h" +#include "chrome/browser/chromeos/gdata/gdata_documents_service.h" #include "chrome/browser/chromeos/gdata/gdata_file_system_proxy.h" #include "chrome/browser/chromeos/gdata/gdata_operation_registry.h" #include "chrome/browser/chromeos/gdata/gdata_system_service.h" @@ -1862,7 +1863,7 @@ ListValue* GetFileTransfersFunction::GetFileTransfersList() { return NULL; std::vector<gdata::GDataOperationRegistry::ProgressStatus> - list = system_service->file_system()->GetOperationRegistry()-> + list = system_service->docs_service()->operation_registry()-> GetProgressStatusList(); return file_manager_util::ProgressStatusVectorToListValue( profile_, source_url_.GetOrigin(), list); @@ -1919,7 +1920,7 @@ void CancelFileTransfersFunction::GetLocalPathsResponseOnUIThread( } gdata::GDataOperationRegistry* operation_registry = - system_service->file_system()->GetOperationRegistry(); + system_service->docs_service()->operation_registry(); scoped_ptr<ListValue> responses(new ListValue()); for (size_t i = 0; i < files.size(); ++i) { diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.cc b/chrome/browser/chromeos/gdata/gdata_file_system.cc index 4bb652f..d94db51 100644 --- a/chrome/browser/chromeos/gdata/gdata_file_system.cc +++ b/chrome/browser/chromeos/gdata/gdata_file_system.cc @@ -2794,10 +2794,6 @@ void GDataFileSystem::OnGetAvailableSpace( feed->quota_bytes_used()); } -GDataOperationRegistry* GDataFileSystem::GetOperationRegistry() { - return documents_service_->operation_registry(); -} - void GDataFileSystem::OnCreateDirectoryCompleted( const CreateDirectoryParams& params, GDataErrorCode status, diff --git a/chrome/browser/chromeos/gdata/gdata_file_system.h b/chrome/browser/chromeos/gdata/gdata_file_system.h index a8f73b0..f0d9bf8 100644 --- a/chrome/browser/chromeos/gdata/gdata_file_system.h +++ b/chrome/browser/chromeos/gdata/gdata_file_system.h @@ -12,6 +12,7 @@ #include "base/memory/scoped_ptr.h" #include "base/memory/weak_ptr.h" +#include "base/observer_list.h" #include "base/platform_file.h" #include "base/timer.h" #include "base/synchronization/lock.h" @@ -19,7 +20,6 @@ #include "chrome/browser/chromeos/gdata/find_entry_callback.h" #include "chrome/browser/chromeos/gdata/gdata_cache.h" #include "chrome/browser/chromeos/gdata/gdata_files.h" -#include "chrome/browser/chromeos/gdata/gdata_operation_registry.h" #include "chrome/browser/prefs/pref_change_registrar.h" #include "content/public/browser/notification_observer.h" @@ -342,10 +342,6 @@ class GDataFileSystemInterface { const GetFileCallback& get_file_callback, const GetDownloadDataCallback& get_download_data_callback) = 0; - // Gets the operation registry that manages all operations performed through - // the GDataFileSystem object. - virtual GDataOperationRegistry* GetOperationRegistry() = 0; - // Gets the cache state of file corresponding to |resource_id| and |md5| if it // exists on disk. // Initializes cache if it has not been initialized. @@ -505,7 +501,6 @@ class GDataFileSystem : public GDataFileSystemInterface, const std::string& resource_id, const GetFileCallback& get_file_callback, const GetDownloadDataCallback& get_download_data_callback) OVERRIDE; - virtual GDataOperationRegistry* GetOperationRegistry() OVERRIDE; virtual void GetCacheState(const std::string& resource_id, const std::string& md5, const GetCacheStateCallback& callback) OVERRIDE; diff --git a/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc b/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc index 917167c..ea671cf 100644 --- a/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc +++ b/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc @@ -16,8 +16,10 @@ #include "base/string_util.h" #include "base/threading/sequenced_worker_pool.h" #include "base/utf_string_conversions.h" +#include "chrome/browser/chromeos/gdata/gdata_documents_service.h" #include "chrome/browser/chromeos/gdata/gdata_file_system.h" #include "chrome/browser/chromeos/gdata/gdata_files.h" +#include "chrome/browser/chromeos/gdata/gdata_operation_registry.h" #include "chrome/browser/chromeos/gdata/gdata_system_service.h" #include "chrome/browser/chromeos/gdata/gdata_util.h" #include "chrome/browser/profiles/profile.h" @@ -82,21 +84,24 @@ bool ParseDriveUrl(const std::string& path, std::string* resource_id) { return resource_id->size(); } -} // namespace +// Helper function to get GDataSystemService from Profile. +GDataSystemService* GetSystemService() { + return GDataSystemServiceFactory::GetForProfile( + ProfileManager::GetDefaultProfile()); +} // Helper function to get GDataFileSystem from Profile on UI thread. void GetFileSystemOnUIThread(GDataFileSystem** file_system) { - GDataSystemService* system_service = GDataSystemServiceFactory::GetForProfile( - ProfileManager::GetDefaultProfile()); + GDataSystemService* system_service = GetSystemService(); *file_system = system_service ? system_service->file_system() : NULL; } // Helper function to cancel GData download operation on UI thread. void CancelGDataDownloadOnUIThread(const FilePath& gdata_file_path) { - GDataFileSystem* file_system = NULL; - GetFileSystemOnUIThread(&file_system); - if (file_system) - file_system->GetOperationRegistry()->CancelForFilePath(gdata_file_path); + GDataSystemService* system_service = GetSystemService(); + if (system_service) + system_service->docs_service()->operation_registry()->CancelForFilePath( + gdata_file_path); } // GDataURLRequesetJob is the gateway between network-level drive://... @@ -890,6 +895,8 @@ void GDataURLRequestJob::HeadersCompleted(int status_code, NotifyHeadersComplete(); } +} // namespace + /////////////////////////////////////////////////////////////////////////////// // GDataProtocolHandler class diff --git a/chrome/browser/chromeos/gdata/mock_gdata_file_system.h b/chrome/browser/chromeos/gdata/mock_gdata_file_system.h index 2768f46..9e32116 100644 --- a/chrome/browser/chromeos/gdata/mock_gdata_file_system.h +++ b/chrome/browser/chromeos/gdata/mock_gdata_file_system.h @@ -66,7 +66,6 @@ class MockGDataFileSystem : public GDataFileSystemInterface { void(const std::string& resource_id, const GetFileCallback& get_file_callback, const GetDownloadDataCallback& get_download_data_callback)); - MOCK_METHOD0(GetOperationRegistry, GDataOperationRegistry*()); MOCK_METHOD3(GetCacheState, void(const std::string& resource_id, const std::string& md5, const GetCacheStateCallback& callback)); diff --git a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc index b07b1ed..1e7aa7f 100644 --- a/chrome/browser/chromeos/system/ash_system_tray_delegate.cc +++ b/chrome/browser/chromeos/system/ash_system_tray_delegate.cc @@ -31,6 +31,8 @@ #include "chrome/browser/chromeos/bluetooth/bluetooth_device.h" #include "chrome/browser/chromeos/cros/cros_library.h" #include "chrome/browser/chromeos/cros/network_library.h" +#include "chrome/browser/chromeos/gdata/gdata_documents_service.h" +#include "chrome/browser/chromeos/gdata/gdata_operation_registry.h" #include "chrome/browser/chromeos/gdata/gdata_system_service.h" #include "chrome/browser/chromeos/gdata/gdata_util.h" #include "chrome/browser/chromeos/input_method/input_method_manager.h" @@ -235,8 +237,8 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, if (gdata::util::IsGDataAvailable(profile)) { GDataSystemService* system_service = GDataSystemServiceFactory::FindForProfile(profile); - if (system_service && system_service->file_system()) { - system_service->file_system()->GetOperationRegistry()-> + if (system_service) { + system_service->docs_service()->operation_registry()-> RemoveObserver(this); } } @@ -465,10 +467,10 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, GDataSystemService* system_service = GDataSystemServiceFactory::FindForProfile(profile); - if (!system_service || !system_service->file_system()) + if (!system_service) return; - system_service->file_system()->GetOperationRegistry()->CancelForFilePath( + system_service->docs_service()->operation_registry()->CancelForFilePath( file_path); } @@ -480,11 +482,11 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, GDataSystemService* system_service = GDataSystemServiceFactory::FindForProfile(profile); - if (!system_service || !system_service->file_system()) + if (!system_service) return; *list = GetDriveStatusList( - system_service->file_system()->GetOperationRegistry()-> + system_service->docs_service()->operation_registry()-> GetProgressStatusList()); } @@ -781,11 +783,10 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, if (gdata::util::IsGDataAvailable(profile)) { GDataSystemService* system_service = GDataSystemServiceFactory::FindForProfile(profile); - if (!system_service || !system_service->file_system()) + if (!system_service) return; - system_service->file_system()->GetOperationRegistry()-> - AddObserver(this); + system_service->docs_service()->operation_registry()->AddObserver(this); } } @@ -1119,10 +1120,10 @@ class SystemTrayDelegate : public ash::SystemTrayDelegate, GDataSystemService* system_service = GDataSystemServiceFactory::FindForProfile(profile); - if (!system_service || !system_service->file_system()) + if (!system_service) return; - OnProgressUpdate(system_service->file_system()->GetOperationRegistry()-> + OnProgressUpdate(system_service->docs_service()->operation_registry()-> GetProgressStatusList()); } |