Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Unified Diff: chrome/browser/chromeos/gdata/gdata_protocol_handler.cc

Issue 10533042: Remove chromeos::GDataFileSystem::GetOperationRegistry() (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 917167cc47955ccd8838fccc4577bb4804a2709f..ea671cfd385b9239aa43d8d85731843ac0930f9a 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
« no previous file with comments | « chrome/browser/chromeos/gdata/gdata_file_system.cc ('k') | chrome/browser/chromeos/gdata/mock_gdata_file_system.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698