| 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_FILE_SYSTEM_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 6 #define CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 }; | 355 }; |
| 356 | 356 |
| 357 // The production implementation of GDataFileSystemInterface. | 357 // The production implementation of GDataFileSystemInterface. |
| 358 class GDataFileSystem : public GDataFileSystemInterface, | 358 class GDataFileSystem : public GDataFileSystemInterface, |
| 359 public content::NotificationObserver { | 359 public content::NotificationObserver { |
| 360 public: | 360 public: |
| 361 GDataFileSystem( | 361 GDataFileSystem( |
| 362 Profile* profile, | 362 Profile* profile, |
| 363 GDataCache* cache, | 363 GDataCache* cache, |
| 364 DocumentsServiceInterface* documents_service, | 364 DocumentsServiceInterface* documents_service, |
| 365 GDataUploaderInterface* uploader, |
| 365 const base::SequencedWorkerPool::SequenceToken& sequence_token); | 366 const base::SequencedWorkerPool::SequenceToken& sequence_token); |
| 366 virtual ~GDataFileSystem(); | 367 virtual ~GDataFileSystem(); |
| 367 | 368 |
| 368 // GDataFileSystem overrides. | 369 // GDataFileSystem overrides. |
| 369 virtual void Initialize() OVERRIDE; | 370 virtual void Initialize() OVERRIDE; |
| 370 virtual void AddObserver(Observer* observer) OVERRIDE; | 371 virtual void AddObserver(Observer* observer) OVERRIDE; |
| 371 virtual void RemoveObserver(Observer* observer) OVERRIDE; | 372 virtual void RemoveObserver(Observer* observer) OVERRIDE; |
| 372 virtual void StartUpdates() OVERRIDE; | 373 virtual void StartUpdates() OVERRIDE; |
| 373 virtual void StopUpdates() OVERRIDE; | 374 virtual void StopUpdates() OVERRIDE; |
| 374 virtual void CheckForUpdates() OVERRIDE; | 375 virtual void CheckForUpdates() OVERRIDE; |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1128 // other threads with base::Unretained(this). | 1129 // other threads with base::Unretained(this). |
| 1129 | 1130 |
| 1130 scoped_ptr<GDataRootDirectory> root_; | 1131 scoped_ptr<GDataRootDirectory> root_; |
| 1131 | 1132 |
| 1132 // The profile hosts the GDataFileSystem via GDataSystemService. | 1133 // The profile hosts the GDataFileSystem via GDataSystemService. |
| 1133 Profile* profile_; | 1134 Profile* profile_; |
| 1134 | 1135 |
| 1135 // The cache owned by GDataSystemService. | 1136 // The cache owned by GDataSystemService. |
| 1136 GDataCache* cache_; | 1137 GDataCache* cache_; |
| 1137 | 1138 |
| 1139 // The uploader owned by GDataSystemService. |
| 1140 GDataUploaderInterface* uploader_; |
| 1141 |
| 1138 // The document service owned by GDataSystemService. | 1142 // The document service owned by GDataSystemService. |
| 1139 DocumentsServiceInterface* documents_service_; | 1143 DocumentsServiceInterface* documents_service_; |
| 1140 | 1144 |
| 1141 // Periodic timer for checking updates. | 1145 // Periodic timer for checking updates. |
| 1142 base::Timer update_timer_; | 1146 base::Timer update_timer_; |
| 1143 | 1147 |
| 1144 // True if hosted documents should be hidden. | 1148 // True if hosted documents should be hidden. |
| 1145 bool hide_hosted_docs_; | 1149 bool hide_hosted_docs_; |
| 1146 | 1150 |
| 1147 // The set of paths opened by OpenFile but not yet closed by CloseFile. | 1151 // The set of paths opened by OpenFile but not yet closed by CloseFile. |
| 1148 std::set<FilePath> open_files_; | 1152 std::set<FilePath> open_files_; |
| 1149 | 1153 |
| 1150 scoped_ptr<PrefChangeRegistrar> pref_registrar_; | 1154 scoped_ptr<PrefChangeRegistrar> pref_registrar_; |
| 1151 | 1155 |
| 1152 // WeakPtrFactory and WeakPtr bound to the UI thread. | 1156 // WeakPtrFactory and WeakPtr bound to the UI thread. |
| 1153 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; | 1157 base::WeakPtrFactory<GDataFileSystem> ui_weak_ptr_factory_; |
| 1154 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; | 1158 base::WeakPtr<GDataFileSystem> ui_weak_ptr_; |
| 1155 | 1159 |
| 1156 ObserverList<Observer> observers_; | 1160 ObserverList<Observer> observers_; |
| 1157 | 1161 |
| 1158 // The token is used to post tasks to the blocking pool in sequence. | 1162 // The token is used to post tasks to the blocking pool in sequence. |
| 1159 const base::SequencedWorkerPool::SequenceToken sequence_token_; | 1163 const base::SequencedWorkerPool::SequenceToken sequence_token_; |
| 1160 }; | 1164 }; |
| 1161 | 1165 |
| 1162 } // namespace gdata | 1166 } // namespace gdata |
| 1163 | 1167 |
| 1164 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ | 1168 #endif // CHROME_BROWSER_CHROMEOS_GDATA_GDATA_FILE_SYSTEM_H_ |
| OLD | NEW |