| 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_INTEGRATION_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_INTEGRATION_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_INTEGRATION_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_INTEGRATION_SERVICE_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class SequencedTaskRunner; | 22 class SequencedTaskRunner; |
| 23 } | 23 } |
| 24 | 24 |
| 25 namespace drive { | 25 namespace drive { |
| 26 | 26 |
| 27 class DebugInfoCollector; | 27 class DebugInfoCollector; |
| 28 class DownloadHandler; | 28 class DownloadHandler; |
| 29 class DriveAppRegistry; | 29 class DriveAppRegistry; |
| 30 class DriveServiceInterface; | 30 class DriveServiceInterface; |
| 31 class FileSystemInterface; | 31 class FileSystemInterface; |
| 32 class FileWriteHelper; | |
| 33 class JobListInterface; | 32 class JobListInterface; |
| 34 | 33 |
| 35 namespace internal { | 34 namespace internal { |
| 36 class FileCache; | 35 class FileCache; |
| 37 class ResourceMetadata; | 36 class ResourceMetadata; |
| 38 class ResourceMetadataStorage; | 37 class ResourceMetadataStorage; |
| 39 } // namespace internal | 38 } // namespace internal |
| 40 | 39 |
| 41 // Interface for classes that need to observe events from | 40 // Interface for classes that need to observe events from |
| 42 // DriveIntegrationService. All events are notified on UI thread. | 41 // DriveIntegrationService. All events are notified on UI thread. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 virtual void OnPushNotificationEnabled(bool enabled) OVERRIDE; | 91 virtual void OnPushNotificationEnabled(bool enabled) OVERRIDE; |
| 93 | 92 |
| 94 DriveServiceInterface* drive_service() { | 93 DriveServiceInterface* drive_service() { |
| 95 return drive_service_.get(); | 94 return drive_service_.get(); |
| 96 } | 95 } |
| 97 | 96 |
| 98 DebugInfoCollector* debug_info_collector() { | 97 DebugInfoCollector* debug_info_collector() { |
| 99 return debug_info_collector_.get(); | 98 return debug_info_collector_.get(); |
| 100 } | 99 } |
| 101 FileSystemInterface* file_system() { return file_system_.get(); } | 100 FileSystemInterface* file_system() { return file_system_.get(); } |
| 102 FileWriteHelper* file_write_helper() { return file_write_helper_.get(); } | |
| 103 DownloadHandler* download_handler() { return download_handler_.get(); } | 101 DownloadHandler* download_handler() { return download_handler_.get(); } |
| 104 DriveAppRegistry* drive_app_registry() { return drive_app_registry_.get(); } | 102 DriveAppRegistry* drive_app_registry() { return drive_app_registry_.get(); } |
| 105 JobListInterface* job_list() { return scheduler_.get(); } | 103 JobListInterface* job_list() { return scheduler_.get(); } |
| 106 | 104 |
| 107 // Clears all the local cache file, the local resource metadata, and | 105 // Clears all the local cache file, the local resource metadata, and |
| 108 // in-memory Drive app registry, and remounts the file system. |callback| | 106 // in-memory Drive app registry, and remounts the file system. |callback| |
| 109 // is called with true when this operation is done successfully. Otherwise, | 107 // is called with true when this operation is done successfully. Otherwise, |
| 110 // |callback| is called with false. |callback| must not be null. | 108 // |callback| is called with false. |callback| must not be null. |
| 111 void ClearCacheAndRemountFileSystem( | 109 void ClearCacheAndRemountFileSystem( |
| 112 const base::Callback<void(bool)>& callback); | 110 const base::Callback<void(bool)>& callback); |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 143 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 146 scoped_ptr<internal::ResourceMetadataStorage, | 144 scoped_ptr<internal::ResourceMetadataStorage, |
| 147 util::DestroyHelper> metadata_storage_; | 145 util::DestroyHelper> metadata_storage_; |
| 148 scoped_ptr<internal::FileCache, util::DestroyHelper> cache_; | 146 scoped_ptr<internal::FileCache, util::DestroyHelper> cache_; |
| 149 scoped_ptr<DriveServiceInterface> drive_service_; | 147 scoped_ptr<DriveServiceInterface> drive_service_; |
| 150 scoped_ptr<JobScheduler> scheduler_; | 148 scoped_ptr<JobScheduler> scheduler_; |
| 151 scoped_ptr<DriveAppRegistry> drive_app_registry_; | 149 scoped_ptr<DriveAppRegistry> drive_app_registry_; |
| 152 scoped_ptr<internal::ResourceMetadata, | 150 scoped_ptr<internal::ResourceMetadata, |
| 153 util::DestroyHelper> resource_metadata_; | 151 util::DestroyHelper> resource_metadata_; |
| 154 scoped_ptr<FileSystemInterface> file_system_; | 152 scoped_ptr<FileSystemInterface> file_system_; |
| 155 scoped_ptr<FileWriteHelper> file_write_helper_; | |
| 156 scoped_ptr<DownloadHandler> download_handler_; | 153 scoped_ptr<DownloadHandler> download_handler_; |
| 157 scoped_ptr<DebugInfoCollector> debug_info_collector_; | 154 scoped_ptr<DebugInfoCollector> debug_info_collector_; |
| 158 | 155 |
| 159 ObserverList<DriveIntegrationServiceObserver> observers_; | 156 ObserverList<DriveIntegrationServiceObserver> observers_; |
| 160 | 157 |
| 161 // Note: This should remain the last member so it'll be destroyed and | 158 // Note: This should remain the last member so it'll be destroyed and |
| 162 // invalidate its weak pointers before any other members are destroyed. | 159 // invalidate its weak pointers before any other members are destroyed. |
| 163 base::WeakPtrFactory<DriveIntegrationService> weak_ptr_factory_; | 160 base::WeakPtrFactory<DriveIntegrationService> weak_ptr_factory_; |
| 164 DISALLOW_COPY_AND_ASSIGN(DriveIntegrationService); | 161 DISALLOW_COPY_AND_ASSIGN(DriveIntegrationService); |
| 165 }; | 162 }; |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 // BrowserContextKeyedServiceFactory: | 211 // BrowserContextKeyedServiceFactory: |
| 215 virtual BrowserContextKeyedService* BuildServiceInstanceFor( | 212 virtual BrowserContextKeyedService* BuildServiceInstanceFor( |
| 216 content::BrowserContext* context) const OVERRIDE; | 213 content::BrowserContext* context) const OVERRIDE; |
| 217 | 214 |
| 218 FactoryCallback factory_for_test_; | 215 FactoryCallback factory_for_test_; |
| 219 }; | 216 }; |
| 220 | 217 |
| 221 } // namespace drive | 218 } // namespace drive |
| 222 | 219 |
| 223 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_INTEGRATION_SERVICE_H_ | 220 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_INTEGRATION_SERVICE_H_ |
| OLD | NEW |