| 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 22 matching lines...) Expand all Loading... |
| 33 } | 33 } |
| 34 | 34 |
| 35 namespace file_manager { | 35 namespace file_manager { |
| 36 | 36 |
| 37 class DesktopNotifications; | 37 class DesktopNotifications; |
| 38 | 38 |
| 39 // Monitors changes in disk mounts, network connection state and preferences | 39 // Monitors changes in disk mounts, network connection state and preferences |
| 40 // affecting File Manager. Dispatches appropriate File Browser events. | 40 // affecting File Manager. Dispatches appropriate File Browser events. |
| 41 class EventRouter | 41 class EventRouter |
| 42 : public chromeos::NetworkStateHandlerObserver, | 42 : public chromeos::NetworkStateHandlerObserver, |
| 43 public drive::DriveIntegrationServiceObserver, | |
| 44 public drive::FileSystemObserver, | 43 public drive::FileSystemObserver, |
| 45 public drive::JobListObserver, | 44 public drive::JobListObserver, |
| 46 public drive::DriveServiceObserver, | 45 public drive::DriveServiceObserver, |
| 47 public VolumeManagerObserver { | 46 public VolumeManagerObserver { |
| 48 public: | 47 public: |
| 49 explicit EventRouter(Profile* profile); | 48 explicit EventRouter(Profile* profile); |
| 50 virtual ~EventRouter(); | 49 virtual ~EventRouter(); |
| 51 | 50 |
| 52 void Shutdown(); | 51 void Shutdown(); |
| 53 | 52 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 virtual void OnJobDone(const drive::JobInfo& job_info, | 84 virtual void OnJobDone(const drive::JobInfo& job_info, |
| 86 drive::FileError error) OVERRIDE; | 85 drive::FileError error) OVERRIDE; |
| 87 | 86 |
| 88 // drive::DriveServiceObserver overrides. | 87 // drive::DriveServiceObserver overrides. |
| 89 virtual void OnRefreshTokenInvalid() OVERRIDE; | 88 virtual void OnRefreshTokenInvalid() OVERRIDE; |
| 90 | 89 |
| 91 // drive::FileSystemObserver overrides. | 90 // drive::FileSystemObserver overrides. |
| 92 virtual void OnDirectoryChanged( | 91 virtual void OnDirectoryChanged( |
| 93 const base::FilePath& directory_path) OVERRIDE; | 92 const base::FilePath& directory_path) OVERRIDE; |
| 94 | 93 |
| 95 // drive::DriveIntegrationServiceObserver overrides. | |
| 96 // TODO(hidehiko): Move these to VolumeManager. | |
| 97 virtual void OnFileSystemMounted() OVERRIDE; | |
| 98 virtual void OnFileSystemBeingUnmounted() OVERRIDE; | |
| 99 | |
| 100 // VolumeManagerObserver overrides. | 94 // VolumeManagerObserver overrides. |
| 101 virtual void OnDiskAdded( | 95 virtual void OnDiskAdded( |
| 102 const chromeos::disks::DiskMountManager::Disk& disk, | 96 const chromeos::disks::DiskMountManager::Disk& disk, |
| 103 bool mounting) OVERRIDE; | 97 bool mounting) OVERRIDE; |
| 104 virtual void OnDiskRemoved( | 98 virtual void OnDiskRemoved( |
| 105 const chromeos::disks::DiskMountManager::Disk& disk) OVERRIDE; | 99 const chromeos::disks::DiskMountManager::Disk& disk) OVERRIDE; |
| 106 virtual void OnDeviceAdded(const std::string& device_path) OVERRIDE; | 100 virtual void OnDeviceAdded(const std::string& device_path) OVERRIDE; |
| 107 virtual void OnDeviceRemoved(const std::string& device_path) OVERRIDE; | 101 virtual void OnDeviceRemoved(const std::string& device_path) OVERRIDE; |
| 108 virtual void OnVolumeMounted(chromeos::MountError error_code, | 102 virtual void OnVolumeMounted(chromeos::MountError error_code, |
| 109 const VolumeInfo& volume_info, | 103 const VolumeInfo& volume_info, |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 | 153 |
| 160 // Note: This should remain the last member so it'll be destroyed and | 154 // Note: This should remain the last member so it'll be destroyed and |
| 161 // invalidate the weak pointers before any other members are destroyed. | 155 // invalidate the weak pointers before any other members are destroyed. |
| 162 base::WeakPtrFactory<EventRouter> weak_factory_; | 156 base::WeakPtrFactory<EventRouter> weak_factory_; |
| 163 DISALLOW_COPY_AND_ASSIGN(EventRouter); | 157 DISALLOW_COPY_AND_ASSIGN(EventRouter); |
| 164 }; | 158 }; |
| 165 | 159 |
| 166 } // namespace file_manager | 160 } // namespace file_manager |
| 167 | 161 |
| 168 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ | 162 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ |
| OLD | NEW |