Chromium Code Reviews| 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_GDATA_GDATA_SYSTEM_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_SYSTEM_SERVICE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_SYSTEM_SERVICE_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_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" |
| 11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
| 12 #include "base/threading/sequenced_worker_pool.h" | 12 #include "base/threading/sequenced_worker_pool.h" |
| 13 #include "chrome/browser/chromeos/gdata/gdata_errorcode.h" | |
| 13 #include "chrome/browser/profiles/profile_keyed_service.h" | 14 #include "chrome/browser/profiles/profile_keyed_service.h" |
| 14 #include "chrome/browser/profiles/profile_keyed_service_factory.h" | 15 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
| 15 | 16 |
| 16 class FilePath; | 17 class FilePath; |
| 17 | 18 |
| 18 namespace gdata { | 19 namespace gdata { |
| 19 | 20 |
| 20 class DocumentsServiceInterface; | 21 class DocumentsServiceInterface; |
| 21 class DriveWebAppsRegistry; | 22 class DriveWebAppsRegistry; |
| 22 class GDataCache; | 23 class GDataCache; |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 34 // created per-profile. | 35 // created per-profile. |
| 35 class GDataSystemService : public ProfileKeyedService { | 36 class GDataSystemService : public ProfileKeyedService { |
| 36 public: | 37 public: |
| 37 DocumentsServiceInterface* docs_service() { return documents_service_.get(); } | 38 DocumentsServiceInterface* docs_service() { return documents_service_.get(); } |
| 38 GDataCache* cache() { return cache_; } | 39 GDataCache* cache() { return cache_; } |
| 39 GDataFileSystemInterface* file_system() { return file_system_.get(); } | 40 GDataFileSystemInterface* file_system() { return file_system_.get(); } |
| 40 GDataUploader* uploader() { return uploader_.get(); } | 41 GDataUploader* uploader() { return uploader_.get(); } |
| 41 GDataContactsService* contacts_service() { return contacts_service_.get(); } | 42 GDataContactsService* contacts_service() { return contacts_service_.get(); } |
| 42 DriveWebAppsRegistry* webapps_registry() { return webapps_registry_.get(); } | 43 DriveWebAppsRegistry* webapps_registry() { return webapps_registry_.get(); } |
| 43 | 44 |
| 45 void ClearCacheAndResetOnUIThread(); | |
|
satorux1
2012/08/01 20:50:31
function comment is missing.
yoshiki
2012/08/01 21:44:59
Done.
| |
| 46 | |
| 44 // ProfileKeyedService override: | 47 // ProfileKeyedService override: |
| 45 virtual void Shutdown() OVERRIDE; | 48 virtual void Shutdown() OVERRIDE; |
| 46 | 49 |
| 47 private: | 50 private: |
| 48 explicit GDataSystemService(Profile* profile); | 51 explicit GDataSystemService(Profile* profile); |
| 49 virtual ~GDataSystemService(); | 52 virtual ~GDataSystemService(); |
| 50 | 53 |
| 51 // Initializes the object. This function should be called before any | 54 // Initializes the object. This function should be called before any |
| 52 // other functions. | 55 // other functions. |
| 53 void Initialize(DocumentsServiceInterface* documents_service, | 56 void Initialize(DocumentsServiceInterface* documents_service, |
| 54 const FilePath& cache_root); | 57 const FilePath& cache_root); |
| 55 | 58 |
| 56 // Registers remote file system proxy for drive mount point. | 59 // Registers remote file system proxy for drive mount point. |
| 57 void AddDriveMountPoint(); | 60 void AddDriveMountPoint(); |
| 58 // Unregisters drive mount point from File API. | 61 // Unregisters drive mount point from File API. |
| 59 void RemoveDriveMountPoint(); | 62 void RemoveDriveMountPoint(); |
| 60 | 63 |
| 64 void ClearCacheAndReset(GDataFileError error, const FilePath& file_path); | |
|
satorux1
2012/08/01 20:50:31
function comment is missing.
yoshiki
2012/08/01 21:44:59
Done.
| |
| 65 | |
| 61 friend class GDataSystemServiceFactory; | 66 friend class GDataSystemServiceFactory; |
| 62 | 67 |
| 63 Profile* profile_; | 68 Profile* profile_; |
| 64 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; | 69 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner_; |
| 65 GDataCache* cache_; | 70 GDataCache* cache_; |
| 66 scoped_ptr<DocumentsServiceInterface> documents_service_; | 71 scoped_ptr<DocumentsServiceInterface> documents_service_; |
| 67 scoped_ptr<GDataUploader> uploader_; | 72 scoped_ptr<GDataUploader> uploader_; |
| 68 scoped_ptr<DriveWebAppsRegistry> webapps_registry_; | 73 scoped_ptr<DriveWebAppsRegistry> webapps_registry_; |
| 69 scoped_ptr<GDataFileSystemInterface> file_system_; | 74 scoped_ptr<GDataFileSystemInterface> file_system_; |
| 70 scoped_ptr<GDataDownloadObserver> download_observer_; | 75 scoped_ptr<GDataDownloadObserver> download_observer_; |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 virtual ~GDataSystemServiceFactory(); | 114 virtual ~GDataSystemServiceFactory(); |
| 110 | 115 |
| 111 // ProfileKeyedServiceFactory: | 116 // ProfileKeyedServiceFactory: |
| 112 virtual ProfileKeyedService* BuildServiceInstanceFor( | 117 virtual ProfileKeyedService* BuildServiceInstanceFor( |
| 113 Profile* profile) const OVERRIDE; | 118 Profile* profile) const OVERRIDE; |
| 114 }; | 119 }; |
| 115 | 120 |
| 116 } // namespace gdata | 121 } // namespace gdata |
| 117 | 122 |
| 118 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_SYSTEM_SERVICE_H_ | 123 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_SYSTEM_SERVICE_H_ |
| OLD | NEW |