| 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/gdata/gdata_protocol_handler.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_protocol_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 GDataSystemService* system_service = GDataSystemServiceFactory::GetForProfile( | 90 GDataSystemService* system_service = GDataSystemServiceFactory::GetForProfile( |
| 91 ProfileManager::GetDefaultProfile()); | 91 ProfileManager::GetDefaultProfile()); |
| 92 *file_system = system_service ? system_service->file_system() : NULL; | 92 *file_system = system_service ? system_service->file_system() : NULL; |
| 93 } | 93 } |
| 94 | 94 |
| 95 // Helper function to cancel GData download operation on UI thread. | 95 // Helper function to cancel GData download operation on UI thread. |
| 96 void CancelGDataDownloadOnUIThread(const FilePath& gdata_file_path) { | 96 void CancelGDataDownloadOnUIThread(const FilePath& gdata_file_path) { |
| 97 GDataFileSystem* file_system = NULL; | 97 GDataFileSystem* file_system = NULL; |
| 98 GetFileSystemOnUIThread(&file_system); | 98 GetFileSystemOnUIThread(&file_system); |
| 99 if (file_system) | 99 if (file_system) |
| 100 file_system->CancelOperation(gdata_file_path); | 100 file_system->GetOperationRegistry()->CancelForFilePath(gdata_file_path); |
| 101 } | 101 } |
| 102 | 102 |
| 103 // Class delegate to find file by resource id and extract relevant file info. | 103 // Class delegate to find file by resource id and extract relevant file info. |
| 104 class GetFileInfoDelegate : public gdata::FindEntryDelegate { | 104 class GetFileInfoDelegate : public gdata::FindEntryDelegate { |
| 105 public: | 105 public: |
| 106 GetFileInfoDelegate() {} | 106 GetFileInfoDelegate() {} |
| 107 virtual ~GetFileInfoDelegate() {} | 107 virtual ~GetFileInfoDelegate() {} |
| 108 | 108 |
| 109 const std::string& mime_type() const { return mime_type_; } | 109 const std::string& mime_type() const { return mime_type_; } |
| 110 const std::string& file_name() const { return file_name_; } | 110 const std::string& file_name() const { return file_name_; } |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 } | 693 } |
| 694 | 694 |
| 695 // static | 695 // static |
| 696 net::URLRequestJob* GDataProtocolHandler::CreateJob(net::URLRequest* request, | 696 net::URLRequestJob* GDataProtocolHandler::CreateJob(net::URLRequest* request, |
| 697 const std::string& scheme) { | 697 const std::string& scheme) { |
| 698 DVLOG(1) << "Handling url: " << request->url().spec(); | 698 DVLOG(1) << "Handling url: " << request->url().spec(); |
| 699 return new GDataURLRequestJob(request); | 699 return new GDataURLRequestJob(request); |
| 700 } | 700 } |
| 701 | 701 |
| 702 } // namespace gdata | 702 } // namespace gdata |
| OLD | NEW |