Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: chrome/browser/chromeos/drive/drive_file_system.h

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_FILE_SYSTEM_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_H_
6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_H_ 6 #define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/scoped_ptr.h" 11 #include "base/memory/scoped_ptr.h"
12 #include "base/memory/weak_ptr.h" 12 #include "base/memory/weak_ptr.h"
13 #include "base/observer_list.h" 13 #include "base/observer_list.h"
14 #include "base/prefs/public/pref_observer.h"
14 #include "base/timer.h" 15 #include "base/timer.h"
15 #include "chrome/browser/chromeos/drive/drive_cache.h" 16 #include "chrome/browser/chromeos/drive/drive_cache.h"
16 #include "chrome/browser/chromeos/drive/drive_feed_loader_observer.h" 17 #include "chrome/browser/chromeos/drive/drive_feed_loader_observer.h"
17 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h" 18 #include "chrome/browser/chromeos/drive/drive_file_system_interface.h"
18 #include "chrome/browser/chromeos/drive/file_system/drive_operations.h" 19 #include "chrome/browser/chromeos/drive/file_system/drive_operations.h"
19 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h" 20 #include "chrome/browser/chromeos/drive/file_system/operation_observer.h"
20 #include "chrome/browser/google_apis/gdata_errorcode.h" 21 #include "chrome/browser/google_apis/gdata_errorcode.h"
21 #include "content/public/browser/notification_observer.h"
22 22
23 class PrefChangeRegistrar; 23 class PrefChangeRegistrar;
24 24
25 namespace base { 25 namespace base {
26 struct PlatformFileInfo; 26 struct PlatformFileInfo;
27 class SequencedTaskRunner; 27 class SequencedTaskRunner;
28 } 28 }
29 29
30 namespace google_apis { 30 namespace google_apis {
31 class DocumentFeed; 31 class DocumentFeed;
(...skipping 14 matching lines...) Expand all
46 namespace file_system { 46 namespace file_system {
47 class CopyOperation; 47 class CopyOperation;
48 class MoveOperation; 48 class MoveOperation;
49 class RemoveOperation; 49 class RemoveOperation;
50 } 50 }
51 51
52 // The production implementation of DriveFileSystemInterface. 52 // The production implementation of DriveFileSystemInterface.
53 class DriveFileSystem : public DriveFileSystemInterface, 53 class DriveFileSystem : public DriveFileSystemInterface,
54 public DriveFeedLoaderObserver, 54 public DriveFeedLoaderObserver,
55 public file_system::OperationObserver, 55 public file_system::OperationObserver,
56 public content::NotificationObserver { 56 public PrefObserver {
57 public: 57 public:
58 DriveFileSystem(Profile* profile, 58 DriveFileSystem(Profile* profile,
59 DriveCache* cache, 59 DriveCache* cache,
60 google_apis::DriveServiceInterface* drive_service, 60 google_apis::DriveServiceInterface* drive_service,
61 google_apis::DriveUploaderInterface* uploader, 61 google_apis::DriveUploaderInterface* uploader,
62 DriveWebAppsRegistryInterface* webapps_registry, 62 DriveWebAppsRegistryInterface* webapps_registry,
63 base::SequencedTaskRunner* blocking_task_runner); 63 base::SequencedTaskRunner* blocking_task_runner);
64 virtual ~DriveFileSystem(); 64 virtual ~DriveFileSystem();
65 65
66 // DriveFileSystem overrides. 66 // DriveFileSystem overrides.
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 DriveCache::FileOperationType cache_operation, 136 DriveCache::FileOperationType cache_operation,
137 const base::Closure& callback) OVERRIDE; 137 const base::Closure& callback) OVERRIDE;
138 virtual void UpdateEntryData(const std::string& resource_id, 138 virtual void UpdateEntryData(const std::string& resource_id,
139 const std::string& md5, 139 const std::string& md5,
140 scoped_ptr<google_apis::DocumentEntry> entry, 140 scoped_ptr<google_apis::DocumentEntry> entry,
141 const FilePath& file_content_path, 141 const FilePath& file_content_path,
142 const base::Closure& callback) OVERRIDE; 142 const base::Closure& callback) OVERRIDE;
143 virtual DriveFileSystemMetadata GetMetadata() const OVERRIDE; 143 virtual DriveFileSystemMetadata GetMetadata() const OVERRIDE;
144 virtual void Reload() OVERRIDE; 144 virtual void Reload() OVERRIDE;
145 145
146 // content::NotificationObserver implementation. 146 // PrefObserver implementation.
147 virtual void Observe(int type, 147 virtual void OnPreferenceChanged(PrefServiceBase* service,
148 const content::NotificationSource& source, 148 const std::string& pref_name) OVERRIDE;
149 const content::NotificationDetails& details) OVERRIDE;
150 149
151 // file_system::OperationObserver overrides. 150 // file_system::OperationObserver overrides.
152 virtual void OnDirectoryChangedByOperation( 151 virtual void OnDirectoryChangedByOperation(
153 const FilePath& directory_path) OVERRIDE; 152 const FilePath& directory_path) OVERRIDE;
154 153
155 // DriveFeedLoader::Observer overrides. 154 // DriveFeedLoader::Observer overrides.
156 // Used to propagate events from DriveFeedLoader. 155 // Used to propagate events from DriveFeedLoader.
157 virtual void OnDirectoryChanged(const FilePath& directory_path) OVERRIDE; 156 virtual void OnDirectoryChanged(const FilePath& directory_path) OVERRIDE;
158 virtual void OnDocumentFeedFetched(int num_accumulated_entries) OVERRIDE; 157 virtual void OnDocumentFeedFetched(int num_accumulated_entries) OVERRIDE;
159 virtual void OnFeedFromServerLoaded() OVERRIDE; 158 virtual void OnFeedFromServerLoaded() OVERRIDE;
(...skipping 595 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 // from IO thread to UI thread. 754 // from IO thread to UI thread.
756 base::WeakPtr<DriveFileSystem> ui_weak_ptr_; 755 base::WeakPtr<DriveFileSystem> ui_weak_ptr_;
757 756
758 // Polling interval for checking updates in seconds. 757 // Polling interval for checking updates in seconds.
759 int polling_interval_sec_; 758 int polling_interval_sec_;
760 }; 759 };
761 760
762 } // namespace drive 761 } // namespace drive
763 762
764 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_H_ 763 #endif // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698