Index: chrome/browser/chromeos/gdata/gdata_protocol_handler.cc |
diff --git a/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc b/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc |
index 2c4258aaca861b66132844ca472ac4f4d9a8f88a..c00f0c8747536155a63c84bdf1f38f4ec8d63839 100644 |
--- a/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc |
+++ b/chrome/browser/chromeos/gdata/gdata_protocol_handler.cc |
@@ -18,6 +18,7 @@ |
#include "base/utf_string_conversions.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" |
@@ -84,19 +85,24 @@ bool ParseDriveUrl(const std::string& path, std::string* resource_id) { |
} // namespace |
+// Helper function to get GDataSystemService from Profile. |
achuithb
2012/06/07 09:55:39
Any reason why this is not in the anonymous namesp
hashimoto
2012/06/07 10:11:57
Oops, done
achuithb
2012/06/07 10:24:43
Is it possible to also move all the other function
hashimoto
2012/06/07 16:16:21
Done.
|
+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://... |