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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" | 10 #include "chrome/browser/chromeos/gdata/gdata_file_system.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 // implementation for the file manager, and some other sub systems. | 24 // implementation for the file manager, and some other sub systems. |
25 // | 25 // |
26 // The class is essentially a container that manages lifetime of the objects | 26 // The class is essentially a container that manages lifetime of the objects |
27 // that are used to run the GData system. The GDataSystemService object is | 27 // that are used to run the GData system. The GDataSystemService object is |
28 // created per-profile. | 28 // created per-profile. |
29 class GDataSystemService : public ProfileKeyedService { | 29 class GDataSystemService : public ProfileKeyedService { |
30 public: | 30 public: |
31 // Returns the documents service instance. | 31 // Returns the documents service instance. |
32 DocumentsServiceInterface* docs_service() { return documents_service_.get(); } | 32 DocumentsServiceInterface* docs_service() { return documents_service_.get(); } |
33 | 33 |
| 34 // Returns the cache instance. |
| 35 GDataCache* cache() { return cache_.get(); } |
| 36 |
34 // Returns the file system instance. | 37 // Returns the file system instance. |
35 GDataFileSystem* file_system() { return file_system_.get(); } | 38 GDataFileSystem* file_system() { return file_system_.get(); } |
36 | 39 |
37 // Returns the uploader instance. | 40 // Returns the uploader instance. |
38 GDataUploader* uploader() { return uploader_.get(); } | 41 GDataUploader* uploader() { return uploader_.get(); } |
39 | 42 |
40 // Returns the file system instance. | 43 // Returns the file system instance. |
41 DriveWebAppsRegistry* webapps_registry() { return webapps_registry_.get(); } | 44 DriveWebAppsRegistry* webapps_registry() { return webapps_registry_.get(); } |
42 | 45 |
43 // ProfileKeyedService override: | 46 // ProfileKeyedService override: |
44 virtual void Shutdown() OVERRIDE; | 47 virtual void Shutdown() OVERRIDE; |
45 | 48 |
46 private: | 49 private: |
47 explicit GDataSystemService(Profile* profile); | 50 explicit GDataSystemService(Profile* profile); |
48 virtual ~GDataSystemService(); | 51 virtual ~GDataSystemService(); |
49 | 52 |
50 // Initializes the object. This function should be called before any | 53 // Initializes the object. This function should be called before any |
51 // other functions. | 54 // other functions. |
52 void Initialize(); | 55 void Initialize(); |
53 | 56 |
54 friend class GDataSystemServiceFactory; | 57 friend class GDataSystemServiceFactory; |
55 | 58 |
56 Profile* profile_; | 59 Profile* profile_; |
| 60 const base::SequencedWorkerPool::SequenceToken sequence_token_; |
| 61 scoped_ptr<GDataCache> cache_; |
57 scoped_ptr<DocumentsServiceInterface> documents_service_; | 62 scoped_ptr<DocumentsServiceInterface> documents_service_; |
58 scoped_ptr<GDataFileSystem> file_system_; | 63 scoped_ptr<GDataFileSystem> file_system_; |
59 scoped_ptr<GDataUploader> uploader_; | 64 scoped_ptr<GDataUploader> uploader_; |
60 scoped_ptr<GDataDownloadObserver> download_observer_; | 65 scoped_ptr<GDataDownloadObserver> download_observer_; |
61 scoped_ptr<GDataSyncClient> sync_client_; | 66 scoped_ptr<GDataSyncClient> sync_client_; |
62 scoped_ptr<DriveWebAppsRegistry> webapps_registry_; | 67 scoped_ptr<DriveWebAppsRegistry> webapps_registry_; |
63 | 68 |
64 DISALLOW_COPY_AND_ASSIGN(GDataSystemService); | 69 DISALLOW_COPY_AND_ASSIGN(GDataSystemService); |
65 }; | 70 }; |
66 | 71 |
(...skipping 18 matching lines...) Expand all Loading... |
85 virtual ~GDataSystemServiceFactory(); | 90 virtual ~GDataSystemServiceFactory(); |
86 | 91 |
87 // ProfileKeyedServiceFactory: | 92 // ProfileKeyedServiceFactory: |
88 virtual ProfileKeyedService* BuildServiceInstanceFor( | 93 virtual ProfileKeyedService* BuildServiceInstanceFor( |
89 Profile* profile) const OVERRIDE; | 94 Profile* profile) const OVERRIDE; |
90 }; | 95 }; |
91 | 96 |
92 } // namespace gdata | 97 } // namespace gdata |
93 | 98 |
94 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_SYSTEM_SERVICE_H_ | 99 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_SYSTEM_SERVICE_H_ |
OLD | NEW |