| 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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class DriveServiceInterface; | 22 class DriveServiceInterface; |
| 23 class DriveUploader; | 23 class DriveUploader; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace drive { | 26 namespace drive { |
| 27 | 27 |
| 28 class DriveCache; | 28 class DriveCache; |
| 29 class DriveDownloadObserver; | 29 class DriveDownloadObserver; |
| 30 class DriveFileSystemInterface; | 30 class DriveFileSystemInterface; |
| 31 class DriveWebAppsRegistry; | 31 class DriveWebAppsRegistry; |
| 32 class FileWriteHelper; | |
| 33 class DriveSyncClient; | 32 class DriveSyncClient; |
| 34 class DrivePrefetcher; | 33 class DrivePrefetcher; |
| 34 class EventLogger; |
| 35 class FileWriteHelper; |
| 35 class StaleCacheFilesRemover; | 36 class StaleCacheFilesRemover; |
| 36 | 37 |
| 37 // DriveSystemService runs the Drive system, including the Drive file system | 38 // DriveSystemService runs the Drive system, including the Drive file system |
| 38 // implementation for the file manager, and some other sub systems. | 39 // implementation for the file manager, and some other sub systems. |
| 39 // | 40 // |
| 40 // The class is essentially a container that manages lifetime of the objects | 41 // The class is essentially a container that manages lifetime of the objects |
| 41 // that are used to run the Drive system. The DriveSystemService object is | 42 // that are used to run the Drive system. The DriveSystemService object is |
| 42 // created per-profile. | 43 // created per-profile. |
| 43 class DriveSystemService : public ProfileKeyedService, | 44 class DriveSystemService : public ProfileKeyedService, |
| 44 public syncer::InvalidationHandler { | 45 public syncer::InvalidationHandler { |
| 45 public: | 46 public: |
| 46 google_apis::DriveServiceInterface* drive_service() { | 47 google_apis::DriveServiceInterface* drive_service() { |
| 47 return drive_service_.get(); | 48 return drive_service_.get(); |
| 48 } | 49 } |
| 49 | 50 |
| 50 DriveCache* cache() { return cache_; } | 51 DriveCache* cache() { return cache_; } |
| 51 DriveFileSystemInterface* file_system() { return file_system_.get(); } | 52 DriveFileSystemInterface* file_system() { return file_system_.get(); } |
| 52 FileWriteHelper* file_write_helper() { return file_write_helper_.get(); } | 53 FileWriteHelper* file_write_helper() { return file_write_helper_.get(); } |
| 53 google_apis::DriveUploader* uploader() { return uploader_.get(); } | 54 google_apis::DriveUploader* uploader() { return uploader_.get(); } |
| 54 DriveWebAppsRegistry* webapps_registry() { return webapps_registry_.get(); } | 55 DriveWebAppsRegistry* webapps_registry() { return webapps_registry_.get(); } |
| 56 EventLogger* event_logger() { return event_logger_.get(); } |
| 55 | 57 |
| 56 // Clears all the local cache files and in-memory data, and remounts the file | 58 // Clears all the local cache files and in-memory data, and remounts the file |
| 57 // system. | 59 // system. |
| 58 void ClearCacheAndRemountFileSystem( | 60 void ClearCacheAndRemountFileSystem( |
| 59 const base::Callback<void(bool)>& callback); | 61 const base::Callback<void(bool)>& callback); |
| 60 | 62 |
| 61 // Reloads and remounts the file system. | 63 // Reloads and remounts the file system. |
| 62 void ReloadAndRemountFileSystem(); | 64 void ReloadAndRemountFileSystem(); |
| 63 | 65 |
| 64 // ProfileKeyedService override: | 66 // ProfileKeyedService override: |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 friend class DriveSystemServiceFactory; | 107 friend class DriveSystemServiceFactory; |
| 106 | 108 |
| 107 Profile* profile_; | 109 Profile* profile_; |
| 108 // True if Drive is disabled due to initialization errors. | 110 // True if Drive is disabled due to initialization errors. |
| 109 bool drive_disabled_; | 111 bool drive_disabled_; |
| 110 | 112 |
| 111 // True once this is registered to listen to the Drive updates. | 113 // True once this is registered to listen to the Drive updates. |
| 112 bool push_notification_registered_; | 114 bool push_notification_registered_; |
| 113 | 115 |
| 114 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 116 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 117 scoped_ptr<EventLogger> event_logger_; |
| 115 DriveCache* cache_; | 118 DriveCache* cache_; |
| 116 scoped_ptr<google_apis::DriveServiceInterface> drive_service_; | 119 scoped_ptr<google_apis::DriveServiceInterface> drive_service_; |
| 117 scoped_ptr<google_apis::DriveUploader> uploader_; | 120 scoped_ptr<google_apis::DriveUploader> uploader_; |
| 118 scoped_ptr<DriveWebAppsRegistry> webapps_registry_; | 121 scoped_ptr<DriveWebAppsRegistry> webapps_registry_; |
| 119 scoped_ptr<DriveFileSystemInterface> file_system_; | 122 scoped_ptr<DriveFileSystemInterface> file_system_; |
| 120 scoped_ptr<FileWriteHelper> file_write_helper_; | 123 scoped_ptr<FileWriteHelper> file_write_helper_; |
| 121 scoped_ptr<DriveDownloadObserver> download_observer_; | 124 scoped_ptr<DriveDownloadObserver> download_observer_; |
| 122 scoped_ptr<DriveSyncClient> sync_client_; | 125 scoped_ptr<DriveSyncClient> sync_client_; |
| 123 scoped_ptr<DrivePrefetcher> prefetcher_; | 126 scoped_ptr<DrivePrefetcher> prefetcher_; |
| 124 scoped_ptr<StaleCacheFilesRemover> stale_cache_files_remover_; | 127 scoped_ptr<StaleCacheFilesRemover> stale_cache_files_remover_; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 virtual ~DriveSystemServiceFactory(); | 176 virtual ~DriveSystemServiceFactory(); |
| 174 | 177 |
| 175 // ProfileKeyedServiceFactory: | 178 // ProfileKeyedServiceFactory: |
| 176 virtual ProfileKeyedService* BuildServiceInstanceFor( | 179 virtual ProfileKeyedService* BuildServiceInstanceFor( |
| 177 Profile* profile) const OVERRIDE; | 180 Profile* profile) const OVERRIDE; |
| 178 }; | 181 }; |
| 179 | 182 |
| 180 } // namespace drive | 183 } // namespace drive |
| 181 | 184 |
| 182 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SYSTEM_SERVICE_H_ | 185 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_SYSTEM_SERVICE_H_ |
| OLD | NEW |