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> |
11 | 11 |
12 #include "base/files/file_path_watcher.h" | 12 #include "base/files/file_path_watcher.h" |
13 #include "base/memory/linked_ptr.h" | 13 #include "base/memory/linked_ptr.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/string16.h" | 15 #include "base/string16.h" |
16 #include "base/synchronization/lock.h" | 16 #include "base/synchronization/lock.h" |
17 #include "chrome/browser/chromeos/cros/network_library.h" | |
18 #include "chrome/browser/chromeos/drive/drive_file_system_observer.h" | 17 #include "chrome/browser/chromeos/drive/drive_file_system_observer.h" |
19 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h" | 18 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h" |
| 19 #include "chrome/browser/chromeos/net/connectivity_state_helper_observer.h" |
20 #include "chrome/browser/google_apis/drive_service_interface.h" | 20 #include "chrome/browser/google_apis/drive_service_interface.h" |
21 #include "chrome/browser/google_apis/operation_registry.h" | 21 #include "chrome/browser/google_apis/operation_registry.h" |
22 #include "chromeos/disks/disk_mount_manager.h" | 22 #include "chromeos/disks/disk_mount_manager.h" |
23 | 23 |
24 class FileBrowserNotifications; | 24 class FileBrowserNotifications; |
25 class PrefChangeRegistrar; | 25 class PrefChangeRegistrar; |
26 class Profile; | 26 class Profile; |
27 | 27 |
28 namespace drive { | 28 namespace drive { |
29 class DriveEntryProto; | 29 class DriveEntryProto; |
30 class DriveFileSystemInterface; | 30 class DriveFileSystemInterface; |
31 } | 31 } |
32 | 32 |
33 // Monitors changes in disk mounts, network connection state and preferences | 33 // Monitors changes in disk mounts, network connection state and preferences |
34 // affecting File Manager. Dispatches appropriate File Browser events. | 34 // affecting File Manager. Dispatches appropriate File Browser events. |
35 class FileBrowserEventRouter | 35 class FileBrowserEventRouter |
36 : public base::RefCountedThreadSafe<FileBrowserEventRouter>, | 36 : public base::RefCountedThreadSafe<FileBrowserEventRouter>, |
37 public chromeos::disks::DiskMountManager::Observer, | 37 public chromeos::disks::DiskMountManager::Observer, |
38 public chromeos::NetworkLibrary::NetworkManagerObserver, | 38 public chromeos::ConnectivityStateHelperObserver, |
39 public drive::DriveFileSystemObserver, | 39 public drive::DriveFileSystemObserver, |
40 public google_apis::DriveServiceObserver { | 40 public google_apis::DriveServiceObserver { |
41 public: | 41 public: |
42 // Interface that should keep track of the system state in regards to system | 42 // Interface that should keep track of the system state in regards to system |
43 // suspend and resume events. | 43 // suspend and resume events. |
44 // When the |IsResuming()| returns true, it should be able to check if a | 44 // When the |IsResuming()| returns true, it should be able to check if a |
45 // removable device was present before the was system suspended. | 45 // removable device was present before the was system suspended. |
46 class SuspendStateDelegate { | 46 class SuspendStateDelegate { |
47 public: | 47 public: |
48 virtual ~SuspendStateDelegate() {} | 48 virtual ~SuspendStateDelegate() {} |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 virtual void OnMountEvent( | 81 virtual void OnMountEvent( |
82 chromeos::disks::DiskMountManager::MountEvent event, | 82 chromeos::disks::DiskMountManager::MountEvent event, |
83 chromeos::MountError error_code, | 83 chromeos::MountError error_code, |
84 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info) | 84 const chromeos::disks::DiskMountManager::MountPointInfo& mount_info) |
85 OVERRIDE; | 85 OVERRIDE; |
86 virtual void OnFormatEvent( | 86 virtual void OnFormatEvent( |
87 chromeos::disks::DiskMountManager::FormatEvent event, | 87 chromeos::disks::DiskMountManager::FormatEvent event, |
88 chromeos::FormatError error_code, | 88 chromeos::FormatError error_code, |
89 const std::string& device_path) OVERRIDE; | 89 const std::string& device_path) OVERRIDE; |
90 | 90 |
91 // chromeos::NetworkLibrary::NetworkManagerObserver override. | 91 // chromeos::ConnectivityStateHelperObserver override. |
92 virtual void OnNetworkManagerChanged( | 92 virtual void NetworkManagerChanged() OVERRIDE; |
93 chromeos::NetworkLibrary* network_library) OVERRIDE; | |
94 | 93 |
95 // drive::DriveServiceObserver overrides. | 94 // drive::DriveServiceObserver overrides. |
96 virtual void OnProgressUpdate( | 95 virtual void OnProgressUpdate( |
97 const google_apis::OperationProgressStatusList& list) OVERRIDE; | 96 const google_apis::OperationProgressStatusList& list) OVERRIDE; |
98 virtual void OnRefreshTokenInvalid() OVERRIDE; | 97 virtual void OnRefreshTokenInvalid() OVERRIDE; |
99 | 98 |
100 // drive::DriveFileSystemInterface::Observer overrides. | 99 // drive::DriveFileSystemInterface::Observer overrides. |
101 virtual void OnDirectoryChanged( | 100 virtual void OnDirectoryChanged( |
102 const base::FilePath& directory_path) OVERRIDE; | 101 const base::FilePath& directory_path) OVERRIDE; |
103 virtual void OnResourceListFetched(int num_accumulated_entries) OVERRIDE; | 102 virtual void OnResourceListFetched(int num_accumulated_entries) OVERRIDE; |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 Profile* profile_; | 200 Profile* profile_; |
202 base::Lock lock_; | 201 base::Lock lock_; |
203 | 202 |
204 // Number of active update requests on the remote file system. | 203 // Number of active update requests on the remote file system. |
205 int num_remote_update_requests_; | 204 int num_remote_update_requests_; |
206 | 205 |
207 DISALLOW_COPY_AND_ASSIGN(FileBrowserEventRouter); | 206 DISALLOW_COPY_AND_ASSIGN(FileBrowserEventRouter); |
208 }; | 207 }; |
209 | 208 |
210 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ | 209 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_BROWSER_EVENT_ROUTER_H_ |
OLD | NEW |