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" |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
17 #include "base/threading/sequenced_worker_pool.h" | 17 #include "base/threading/sequenced_worker_pool.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
19 #include "chrome/browser/chromeos/gdata/documents_service_interface.h" | 19 #include "chrome/browser/chromeos/gdata/drive_service_interface.h" |
20 #include "chrome/browser/chromeos/gdata/gdata.pb.h" | 20 #include "chrome/browser/chromeos/gdata/gdata.pb.h" |
21 #include "chrome/browser/chromeos/gdata/gdata_directory_service.h" | 21 #include "chrome/browser/chromeos/gdata/gdata_directory_service.h" |
22 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" | 22 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" |
23 #include "chrome/browser/chromeos/gdata/gdata_file_system_interface.h" | 23 #include "chrome/browser/chromeos/gdata/gdata_file_system_interface.h" |
24 #include "chrome/browser/chromeos/gdata/gdata_operation_registry.h" | 24 #include "chrome/browser/chromeos/gdata/gdata_operation_registry.h" |
25 #include "chrome/browser/chromeos/gdata/gdata_system_service.h" | 25 #include "chrome/browser/chromeos/gdata/gdata_system_service.h" |
26 #include "chrome/browser/chromeos/gdata/gdata_util.h" | 26 #include "chrome/browser/chromeos/gdata/gdata_util.h" |
27 #include "chrome/browser/profiles/profile.h" | 27 #include "chrome/browser/profiles/profile.h" |
28 #include "chrome/browser/profiles/profile_manager.h" | 28 #include "chrome/browser/profiles/profile_manager.h" |
29 #include "chrome/common/url_constants.h" | 29 #include "chrome/common/url_constants.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // Helper function to get GDataFileSystem from Profile on UI thread. | 115 // Helper function to get GDataFileSystem from Profile on UI thread. |
116 void GetFileSystemOnUIThread(GDataFileSystemInterface** file_system) { | 116 void GetFileSystemOnUIThread(GDataFileSystemInterface** file_system) { |
117 GDataSystemService* system_service = GetSystemService(); | 117 GDataSystemService* system_service = GetSystemService(); |
118 *file_system = system_service ? system_service->file_system() : NULL; | 118 *file_system = system_service ? system_service->file_system() : NULL; |
119 } | 119 } |
120 | 120 |
121 // Helper function to cancel GData download operation on UI thread. | 121 // Helper function to cancel GData download operation on UI thread. |
122 void CancelGDataDownloadOnUIThread(const FilePath& gdata_file_path) { | 122 void CancelGDataDownloadOnUIThread(const FilePath& gdata_file_path) { |
123 GDataSystemService* system_service = GetSystemService(); | 123 GDataSystemService* system_service = GetSystemService(); |
124 if (system_service) | 124 if (system_service) |
125 system_service->docs_service()->operation_registry()->CancelForFilePath( | 125 system_service->drive_service()->operation_registry()->CancelForFilePath( |
126 gdata_file_path); | 126 gdata_file_path); |
127 } | 127 } |
128 | 128 |
129 // GDataURLRequesetJob is the gateway between network-level drive://... | 129 // GDataURLRequesetJob is the gateway between network-level drive://... |
130 // requests for gdata resources and GDataFileSytem. It exposes content URLs | 130 // requests for gdata resources and GDataFileSytem. It exposes content URLs |
131 // formatted as drive://<resource-id>. | 131 // formatted as drive://<resource-id>. |
132 class GDataURLRequestJob : public net::URLRequestJob { | 132 class GDataURLRequestJob : public net::URLRequestJob { |
133 public: | 133 public: |
134 explicit GDataURLRequestJob(net::URLRequest* request); | 134 explicit GDataURLRequestJob(net::URLRequest* request); |
135 | 135 |
(...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
934 GDataProtocolHandler::~GDataProtocolHandler() { | 934 GDataProtocolHandler::~GDataProtocolHandler() { |
935 } | 935 } |
936 | 936 |
937 net::URLRequestJob* GDataProtocolHandler::MaybeCreateJob( | 937 net::URLRequestJob* GDataProtocolHandler::MaybeCreateJob( |
938 net::URLRequest* request) const { | 938 net::URLRequest* request) const { |
939 DVLOG(1) << "Handling url: " << request->url().spec(); | 939 DVLOG(1) << "Handling url: " << request->url().spec(); |
940 return new GDataURLRequestJob(request); | 940 return new GDataURLRequestJob(request); |
941 } | 941 } |
942 | 942 |
943 } // namespace gdata | 943 } // namespace gdata |
OLD | NEW |