| 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_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 public drive::FileSystemObserver, | 54 public drive::FileSystemObserver, |
| 55 public drive::JobListObserver, | 55 public drive::JobListObserver, |
| 56 public drive::DriveServiceObserver, | 56 public drive::DriveServiceObserver, |
| 57 public VolumeManagerObserver, | 57 public VolumeManagerObserver, |
| 58 public content::NotificationObserver { | 58 public content::NotificationObserver { |
| 59 public: | 59 public: |
| 60 explicit EventRouter(Profile* profile); | 60 explicit EventRouter(Profile* profile); |
| 61 virtual ~EventRouter(); | 61 virtual ~EventRouter(); |
| 62 | 62 |
| 63 // KeyedService overrides. | 63 // KeyedService overrides. |
| 64 virtual void Shutdown() OVERRIDE; | 64 virtual void Shutdown() override; |
| 65 | 65 |
| 66 typedef base::Callback<void(bool success)> BoolCallback; | 66 typedef base::Callback<void(bool success)> BoolCallback; |
| 67 | 67 |
| 68 // Adds a file watch at |local_path|, associated with |virtual_path|, for | 68 // Adds a file watch at |local_path|, associated with |virtual_path|, for |
| 69 // an extension with |extension_id|. | 69 // an extension with |extension_id|. |
| 70 // | 70 // |
| 71 // |callback| will be called with true on success, or false on failure. | 71 // |callback| will be called with true on success, or false on failure. |
| 72 // |callback| must not be null. | 72 // |callback| must not be null. |
| 73 void AddFileWatch(const base::FilePath& local_path, | 73 void AddFileWatch(const base::FilePath& local_path, |
| 74 const base::FilePath& virtual_path, | 74 const base::FilePath& virtual_path, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 86 | 86 |
| 87 // Called when a copy task progress is updated. | 87 // Called when a copy task progress is updated. |
| 88 void OnCopyProgress(int copy_id, | 88 void OnCopyProgress(int copy_id, |
| 89 storage::FileSystemOperation::CopyProgressType type, | 89 storage::FileSystemOperation::CopyProgressType type, |
| 90 const GURL& source_url, | 90 const GURL& source_url, |
| 91 const GURL& destination_url, | 91 const GURL& destination_url, |
| 92 int64 size); | 92 int64 size); |
| 93 | 93 |
| 94 // chromeos::NetworkStateHandlerObserver overrides. | 94 // chromeos::NetworkStateHandlerObserver overrides. |
| 95 virtual void DefaultNetworkChanged( | 95 virtual void DefaultNetworkChanged( |
| 96 const chromeos::NetworkState* network) OVERRIDE; | 96 const chromeos::NetworkState* network) override; |
| 97 | 97 |
| 98 // drive::JobListObserver overrides. | 98 // drive::JobListObserver overrides. |
| 99 virtual void OnJobAdded(const drive::JobInfo& job_info) OVERRIDE; | 99 virtual void OnJobAdded(const drive::JobInfo& job_info) override; |
| 100 virtual void OnJobUpdated(const drive::JobInfo& job_info) OVERRIDE; | 100 virtual void OnJobUpdated(const drive::JobInfo& job_info) override; |
| 101 virtual void OnJobDone(const drive::JobInfo& job_info, | 101 virtual void OnJobDone(const drive::JobInfo& job_info, |
| 102 drive::FileError error) OVERRIDE; | 102 drive::FileError error) override; |
| 103 | 103 |
| 104 // drive::DriveServiceObserver overrides. | 104 // drive::DriveServiceObserver overrides. |
| 105 virtual void OnRefreshTokenInvalid() OVERRIDE; | 105 virtual void OnRefreshTokenInvalid() override; |
| 106 | 106 |
| 107 // drive::FileSystemObserver overrides. | 107 // drive::FileSystemObserver overrides. |
| 108 virtual void OnDirectoryChanged(const base::FilePath& drive_path) OVERRIDE; | 108 virtual void OnDirectoryChanged(const base::FilePath& drive_path) override; |
| 109 virtual void OnFileChanged(const drive::FileChange& changed_files) OVERRIDE; | 109 virtual void OnFileChanged(const drive::FileChange& changed_files) override; |
| 110 virtual void OnDriveSyncError(drive::file_system::DriveSyncErrorType type, | 110 virtual void OnDriveSyncError(drive::file_system::DriveSyncErrorType type, |
| 111 const base::FilePath& drive_path) OVERRIDE; | 111 const base::FilePath& drive_path) override; |
| 112 | 112 |
| 113 // VolumeManagerObserver overrides. | 113 // VolumeManagerObserver overrides. |
| 114 virtual void OnDiskAdded( | 114 virtual void OnDiskAdded( |
| 115 const chromeos::disks::DiskMountManager::Disk& disk, | 115 const chromeos::disks::DiskMountManager::Disk& disk, |
| 116 bool mounting) OVERRIDE; | 116 bool mounting) override; |
| 117 virtual void OnDiskRemoved( | 117 virtual void OnDiskRemoved( |
| 118 const chromeos::disks::DiskMountManager::Disk& disk) OVERRIDE; | 118 const chromeos::disks::DiskMountManager::Disk& disk) override; |
| 119 virtual void OnDeviceAdded(const std::string& device_path) OVERRIDE; | 119 virtual void OnDeviceAdded(const std::string& device_path) override; |
| 120 virtual void OnDeviceRemoved(const std::string& device_path) OVERRIDE; | 120 virtual void OnDeviceRemoved(const std::string& device_path) override; |
| 121 virtual void OnVolumeMounted(chromeos::MountError error_code, | 121 virtual void OnVolumeMounted(chromeos::MountError error_code, |
| 122 const VolumeInfo& volume_info) OVERRIDE; | 122 const VolumeInfo& volume_info) override; |
| 123 virtual void OnVolumeUnmounted(chromeos::MountError error_code, | 123 virtual void OnVolumeUnmounted(chromeos::MountError error_code, |
| 124 const VolumeInfo& volume_info) OVERRIDE; | 124 const VolumeInfo& volume_info) override; |
| 125 virtual void OnFormatStarted( | 125 virtual void OnFormatStarted( |
| 126 const std::string& device_path, bool success) OVERRIDE; | 126 const std::string& device_path, bool success) override; |
| 127 virtual void OnFormatCompleted( | 127 virtual void OnFormatCompleted( |
| 128 const std::string& device_path, bool success) OVERRIDE; | 128 const std::string& device_path, bool success) override; |
| 129 | 129 |
| 130 // content::NotificationObserver overrides. | 130 // content::NotificationObserver overrides. |
| 131 virtual void Observe(int type, | 131 virtual void Observe(int type, |
| 132 const content::NotificationSource& source, | 132 const content::NotificationSource& source, |
| 133 const content::NotificationDetails& details) OVERRIDE; | 133 const content::NotificationDetails& details) override; |
| 134 | 134 |
| 135 private: | 135 private: |
| 136 typedef std::map<base::FilePath, FileWatcher*> WatcherMap; | 136 typedef std::map<base::FilePath, FileWatcher*> WatcherMap; |
| 137 | 137 |
| 138 // Starts observing file system change events. | 138 // Starts observing file system change events. |
| 139 void ObserveEvents(); | 139 void ObserveEvents(); |
| 140 | 140 |
| 141 // Called when prefs related to file manager change. | 141 // Called when prefs related to file manager change. |
| 142 void OnFileManagerPrefsChanged(); | 142 void OnFileManagerPrefsChanged(); |
| 143 | 143 |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 212 |
| 213 // Note: This should remain the last member so it'll be destroyed and | 213 // Note: This should remain the last member so it'll be destroyed and |
| 214 // invalidate the weak pointers before any other members are destroyed. | 214 // invalidate the weak pointers before any other members are destroyed. |
| 215 base::WeakPtrFactory<EventRouter> weak_factory_; | 215 base::WeakPtrFactory<EventRouter> weak_factory_; |
| 216 DISALLOW_COPY_AND_ASSIGN(EventRouter); | 216 DISALLOW_COPY_AND_ASSIGN(EventRouter); |
| 217 }; | 217 }; |
| 218 | 218 |
| 219 } // namespace file_manager | 219 } // namespace file_manager |
| 220 | 220 |
| 221 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ | 221 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ |
| OLD | NEW |