| 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_BROWSER_EVENT_ROUTER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 const FilePath& virtual_path, | 55 const FilePath& virtual_path, |
| 56 const std::string& extension_id); | 56 const std::string& extension_id); |
| 57 void RemoveFileWatch(const FilePath& file_path, | 57 void RemoveFileWatch(const FilePath& file_path, |
| 58 const std::string& extension_id); | 58 const std::string& extension_id); |
| 59 | 59 |
| 60 // Mounts Drive on File browser. |callback| will be called after raising a | 60 // Mounts Drive on File browser. |callback| will be called after raising a |
| 61 // mount request event to file manager on JS-side. | 61 // mount request event to file manager on JS-side. |
| 62 void MountDrive(const base::Closure& callback); | 62 void MountDrive(const base::Closure& callback); |
| 63 | 63 |
| 64 // CrosDisksClient::Observer overrides. | 64 // CrosDisksClient::Observer overrides. |
| 65 virtual void DiskChanged(chromeos::disks::DiskMountManagerEventType event, | 65 virtual void OnDiskEvent( |
| 66 const chromeos::disks::DiskMountManager::Disk* disk) | 66 chromeos::disks::DiskMountManager::DiskEvent event, |
| 67 OVERRIDE; | 67 const chromeos::disks::DiskMountManager::Disk* disk) OVERRIDE; |
| 68 virtual void DeviceChanged(chromeos::disks::DiskMountManagerEventType event, | 68 virtual void OnDeviceEvent( |
| 69 const std::string& device_path) OVERRIDE; | 69 chromeos::disks::DiskMountManager::DeviceEvent event, |
| 70 virtual void MountCompleted( | 70 const std::string& device_path) OVERRIDE; |
| 71 chromeos::disks::DiskMountManager::MountEvent event_type, | 71 virtual void OnMountEvent( |
| 72 chromeos::disks::DiskMountManager::MountEvent event, |
| 72 chromeos::MountError error_code, | 73 chromeos::MountError error_code, |
| 73 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info) | 74 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info) |
| 74 OVERRIDE; | 75 OVERRIDE; |
| 76 virtual void OnFormatEvent( |
| 77 chromeos::disks::DiskMountManager::FormatEvent event, |
| 78 chromeos::FormatError error_code, |
| 79 const std::string& device_path) OVERRIDE; |
| 75 | 80 |
| 76 // chromeos::NetworkLibrary::NetworkManagerObserver override. | 81 // chromeos::NetworkLibrary::NetworkManagerObserver override. |
| 77 virtual void OnNetworkManagerChanged( | 82 virtual void OnNetworkManagerChanged( |
| 78 chromeos::NetworkLibrary* network_library) OVERRIDE; | 83 chromeos::NetworkLibrary* network_library) OVERRIDE; |
| 79 | 84 |
| 80 // Overridden from PrefObserver. | 85 // Overridden from PrefObserver. |
| 81 virtual void OnPreferenceChanged(PrefServiceBase* service, | 86 virtual void OnPreferenceChanged(PrefServiceBase* service, |
| 82 const std::string& pref_name) OVERRIDE; | 87 const std::string& pref_name) OVERRIDE; |
| 83 | 88 |
| 84 // drive::DriveServiceObserver overrides. | 89 // drive::DriveServiceObserver overrides. |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 virtual ~FileBrowserEventRouter(); | 156 virtual ~FileBrowserEventRouter(); |
| 152 | 157 |
| 153 // USB mount event handlers. | 158 // USB mount event handlers. |
| 154 void OnDiskAdded(const chromeos::disks::DiskMountManager::Disk* disk); | 159 void OnDiskAdded(const chromeos::disks::DiskMountManager::Disk* disk); |
| 155 void OnDiskRemoved(const chromeos::disks::DiskMountManager::Disk* disk); | 160 void OnDiskRemoved(const chromeos::disks::DiskMountManager::Disk* disk); |
| 156 void OnDiskMounted(const chromeos::disks::DiskMountManager::Disk* disk); | 161 void OnDiskMounted(const chromeos::disks::DiskMountManager::Disk* disk); |
| 157 void OnDiskUnmounted(const chromeos::disks::DiskMountManager::Disk* disk); | 162 void OnDiskUnmounted(const chromeos::disks::DiskMountManager::Disk* disk); |
| 158 void OnDeviceAdded(const std::string& device_path); | 163 void OnDeviceAdded(const std::string& device_path); |
| 159 void OnDeviceRemoved(const std::string& device_path); | 164 void OnDeviceRemoved(const std::string& device_path); |
| 160 void OnDeviceScanned(const std::string& device_path); | 165 void OnDeviceScanned(const std::string& device_path); |
| 161 void OnFormattingStarted(const std::string& device_path, bool success); | 166 void OnFormatStarted(const std::string& device_path, bool success); |
| 162 void OnFormattingFinished(const std::string& device_path, bool success); | 167 void OnFormatCompleted(const std::string& device_path, bool success); |
| 163 | 168 |
| 164 // Process file watch notifications. | 169 // Process file watch notifications. |
| 165 void HandleFileWatchNotification(const FilePath& path, | 170 void HandleFileWatchNotification(const FilePath& path, |
| 166 bool got_error); | 171 bool got_error); |
| 167 | 172 |
| 168 // Sends directory change event. | 173 // Sends directory change event. |
| 169 void DispatchDirectoryChangeEvent(const FilePath& path, bool error, | 174 void DispatchDirectoryChangeEvent(const FilePath& path, bool error, |
| 170 const ExtensionUsageRegistry& extensions); | 175 const ExtensionUsageRegistry& extensions); |
| 171 | 176 |
| 172 // Sends filesystem changed extension message to all renderers. | 177 // Sends filesystem changed extension message to all renderers. |
| 173 void DispatchDiskEvent(const chromeos::disks::DiskMountManager::Disk* disk, | 178 void DispatchDiskEvent(const chromeos::disks::DiskMountManager::Disk* disk, |
| 174 bool added); | 179 bool added); |
| 175 | 180 |
| 176 void DispatchMountCompletedEvent( | 181 void DispatchMountEvent( |
| 177 chromeos::disks::DiskMountManager::MountEvent event, | 182 chromeos::disks::DiskMountManager::MountEvent event, |
| 178 chromeos::MountError error_code, | 183 chromeos::MountError error_code, |
| 179 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info); | 184 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info); |
| 180 | 185 |
| 181 void RemoveBrowserFromVector(const std::string& path); | 186 void RemoveBrowserFromVector(const std::string& path); |
| 182 | 187 |
| 183 // Used to create a window of a standard size, and add it to a list | 188 // Used to create a window of a standard size, and add it to a list |
| 184 // of tracked browser windows in case that device goes away. | 189 // of tracked browser windows in case that device goes away. |
| 185 void OpenFileBrowse(const std::string& url, | 190 void OpenFileBrowse(const std::string& url, |
| 186 const std::string& device_path, | 191 const std::string& device_path, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 238 |
| 234 FileBrowserEventRouterFactory(); | 239 FileBrowserEventRouterFactory(); |
| 235 virtual ~FileBrowserEventRouterFactory(); | 240 virtual ~FileBrowserEventRouterFactory(); |
| 236 | 241 |
| 237 // ProfileKeyedServiceFactory: | 242 // ProfileKeyedServiceFactory: |
| 238 virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( | 243 virtual scoped_refptr<RefcountedProfileKeyedService> BuildServiceInstanceFor( |
| 239 Profile* profile) const OVERRIDE; | 244 Profile* profile) const OVERRIDE; |
| 240 }; | 245 }; |
| 241 | 246 |
| 242 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ | 247 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ |
| OLD | NEW |