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 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SYSTEM_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SYSTEM_SERVICE_H_ |
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SYSTEM_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SYSTEM_SERVICE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/memory/singleton.h" | 12 #include "base/memory/singleton.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "base/threading/sequenced_worker_pool.h" | 14 #include "base/threading/sequenced_worker_pool.h" |
15 #include "chrome/browser/chromeos/drive/drive_file_error.h" | 15 #include "chrome/browser/chromeos/drive/drive_file_error.h" |
16 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" | 16 #include "chrome/browser/chromeos/drive/drive_file_system_util.h" |
17 #include "chrome/browser/profiles/profile_keyed_service.h" | 17 #include "chrome/browser/profiles/profile_keyed_service.h" |
18 #include "chrome/browser/profiles/profile_keyed_service_factory.h" | 18 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
19 #include "sync/notifier/invalidation_handler.h" | 19 #include "sync/notifier/invalidation_handler.h" |
20 | 20 |
21 namespace base { | 21 namespace base { |
22 class FilePath; | 22 class FilePath; |
23 } | 23 } |
24 | 24 |
25 namespace google_apis { | 25 namespace google_apis { |
26 class DriveServiceInterface; | 26 class DriveServiceInterface; |
27 class DriveUploader; | |
28 } | 27 } |
29 | 28 |
30 namespace drive { | 29 namespace drive { |
31 | 30 |
32 class DriveCache; | 31 class DriveCache; |
33 class DriveDownloadHandler; | 32 class DriveDownloadHandler; |
34 class DriveFileSystemInterface; | 33 class DriveFileSystemInterface; |
35 class DriveFileSystemProxy; | 34 class DriveFileSystemProxy; |
36 class DriveWebAppsRegistry; | 35 class DriveWebAppsRegistry; |
37 class DriveSyncClient; | 36 class DriveSyncClient; |
(...skipping 29 matching lines...) Expand all Loading... |
67 virtual void Shutdown() OVERRIDE; | 66 virtual void Shutdown() OVERRIDE; |
68 | 67 |
69 google_apis::DriveServiceInterface* drive_service() { | 68 google_apis::DriveServiceInterface* drive_service() { |
70 return drive_service_.get(); | 69 return drive_service_.get(); |
71 } | 70 } |
72 | 71 |
73 DriveCache* cache() { return cache_.get(); } | 72 DriveCache* cache() { return cache_.get(); } |
74 DriveFileSystemInterface* file_system() { return file_system_.get(); } | 73 DriveFileSystemInterface* file_system() { return file_system_.get(); } |
75 FileWriteHelper* file_write_helper() { return file_write_helper_.get(); } | 74 FileWriteHelper* file_write_helper() { return file_write_helper_.get(); } |
76 DriveDownloadHandler* download_handler() { return download_handler_.get(); } | 75 DriveDownloadHandler* download_handler() { return download_handler_.get(); } |
77 google_apis::DriveUploader* uploader() { return uploader_.get(); } | |
78 DriveWebAppsRegistry* webapps_registry() { return webapps_registry_.get(); } | 76 DriveWebAppsRegistry* webapps_registry() { return webapps_registry_.get(); } |
79 EventLogger* event_logger() { return event_logger_.get(); } | 77 EventLogger* event_logger() { return event_logger_.get(); } |
80 | 78 |
81 // Clears all the local cache files and in-memory data, and remounts the | 79 // Clears all the local cache files and in-memory data, and remounts the |
82 // file system. |callback| is called with true when this operation is done | 80 // file system. |callback| is called with true when this operation is done |
83 // successfully. Otherwise, |callback| is called with false. | 81 // successfully. Otherwise, |callback| is called with false. |
84 // |callback| must not be null. | 82 // |callback| must not be null. |
85 void ClearCacheAndRemountFileSystem( | 83 void ClearCacheAndRemountFileSystem( |
86 const base::Callback<void(bool)>& callback); | 84 const base::Callback<void(bool)>& callback); |
87 | 85 |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 // True if Drive is disabled due to initialization errors. | 132 // True if Drive is disabled due to initialization errors. |
135 bool drive_disabled_; | 133 bool drive_disabled_; |
136 | 134 |
137 // True once this is registered to listen to the Drive updates. | 135 // True once this is registered to listen to the Drive updates. |
138 bool push_notification_registered_; | 136 bool push_notification_registered_; |
139 | 137 |
140 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 138 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
141 scoped_ptr<EventLogger> event_logger_; | 139 scoped_ptr<EventLogger> event_logger_; |
142 scoped_ptr<DriveCache, util::DestroyHelper> cache_; | 140 scoped_ptr<DriveCache, util::DestroyHelper> cache_; |
143 scoped_ptr<google_apis::DriveServiceInterface> drive_service_; | 141 scoped_ptr<google_apis::DriveServiceInterface> drive_service_; |
144 scoped_ptr<google_apis::DriveUploader> uploader_; | |
145 scoped_ptr<DriveWebAppsRegistry> webapps_registry_; | 142 scoped_ptr<DriveWebAppsRegistry> webapps_registry_; |
146 scoped_ptr<DriveResourceMetadata, util::DestroyHelper> resource_metadata_; | 143 scoped_ptr<DriveResourceMetadata, util::DestroyHelper> resource_metadata_; |
147 scoped_ptr<DriveFileSystemInterface> file_system_; | 144 scoped_ptr<DriveFileSystemInterface> file_system_; |
148 scoped_ptr<FileWriteHelper> file_write_helper_; | 145 scoped_ptr<FileWriteHelper> file_write_helper_; |
149 scoped_ptr<DriveDownloadHandler> download_handler_; | 146 scoped_ptr<DriveDownloadHandler> download_handler_; |
150 scoped_ptr<DriveSyncClient> sync_client_; | 147 scoped_ptr<DriveSyncClient> sync_client_; |
151 scoped_ptr<DrivePrefetcher> prefetcher_; | 148 scoped_ptr<DrivePrefetcher> prefetcher_; |
152 scoped_ptr<StaleCacheFilesRemover> stale_cache_files_remover_; | 149 scoped_ptr<StaleCacheFilesRemover> stale_cache_files_remover_; |
153 scoped_refptr<DriveFileSystemProxy> file_system_proxy_; | 150 scoped_refptr<DriveFileSystemProxy> file_system_proxy_; |
154 | 151 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 // ProfileKeyedServiceFactory: | 201 // ProfileKeyedServiceFactory: |
205 virtual ProfileKeyedService* BuildServiceInstanceFor( | 202 virtual ProfileKeyedService* BuildServiceInstanceFor( |
206 Profile* profile) const OVERRIDE; | 203 Profile* profile) const OVERRIDE; |
207 | 204 |
208 FactoryCallback factory_for_test_; | 205 FactoryCallback factory_for_test_; |
209 }; | 206 }; |
210 | 207 |
211 } // namespace drive | 208 } // namespace drive |
212 | 209 |
213 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SYSTEM_SERVICE_H_ | 210 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SYSTEM_SERVICE_H_ |
OLD | NEW |