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_FILE_MANAGER_EVENT_ROUTE
R_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_EVENT_ROUTE
R_H_ |
6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_EVENT_ROUTE
R_H_ | 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_EVENT_ROUTE
R_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/drive/drive_file_system_observer.h" | 17 #include "chrome/browser/chromeos/drive/drive_file_system_observer.h" |
18 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h" | 18 #include "chrome/browser/chromeos/drive/drive_resource_metadata.h" |
| 19 #include "chrome/browser/chromeos/drive/drive_system_service.h" |
19 #include "chrome/browser/chromeos/net/connectivity_state_helper_observer.h" | 20 #include "chrome/browser/chromeos/net/connectivity_state_helper_observer.h" |
20 #include "chrome/browser/chromeos/system_key_event_listener.h" | 21 #include "chrome/browser/chromeos/system_key_event_listener.h" |
21 #include "chrome/browser/google_apis/drive_service_interface.h" | 22 #include "chrome/browser/google_apis/drive_service_interface.h" |
22 #include "chrome/browser/google_apis/operation_registry.h" | 23 #include "chrome/browser/google_apis/operation_registry.h" |
23 #include "chromeos/disks/disk_mount_manager.h" | 24 #include "chromeos/disks/disk_mount_manager.h" |
24 | 25 |
25 class FileManagerNotifications; | 26 class FileManagerNotifications; |
26 class PrefChangeRegistrar; | 27 class PrefChangeRegistrar; |
27 class Profile; | 28 class Profile; |
28 | 29 |
29 namespace drive { | 30 namespace drive { |
30 class DriveEntryProto; | 31 class DriveEntryProto; |
31 class DriveFileSystemInterface; | 32 class DriveFileSystemInterface; |
32 } | 33 } |
33 | 34 |
34 // Monitors changes in disk mounts, network connection state and preferences | 35 // Monitors changes in disk mounts, network connection state and preferences |
35 // affecting File Manager. Dispatches appropriate File Browser events. | 36 // affecting File Manager. Dispatches appropriate File Browser events. |
36 class FileManagerEventRouter | 37 class FileManagerEventRouter |
37 : public chromeos::disks::DiskMountManager::Observer, | 38 : public chromeos::disks::DiskMountManager::Observer, |
38 public chromeos::ConnectivityStateHelperObserver, | 39 public chromeos::ConnectivityStateHelperObserver, |
39 public chromeos::SystemKeyEventListener::ModifiersObserver, | 40 public chromeos::SystemKeyEventListener::ModifiersObserver, |
| 41 public drive::DriveSystemServiceObserver, |
40 public drive::DriveFileSystemObserver, | 42 public drive::DriveFileSystemObserver, |
41 public google_apis::DriveServiceObserver { | 43 public google_apis::DriveServiceObserver { |
42 public: | 44 public: |
43 // Interface that should keep track of the system state in regards to system | 45 // Interface that should keep track of the system state in regards to system |
44 // suspend and resume events. | 46 // suspend and resume events. |
45 // When the |IsResuming()| returns true, it should be able to check if a | 47 // When the |IsResuming()| returns true, it should be able to check if a |
46 // removable device was present before the was system suspended. | 48 // removable device was present before the was system suspended. |
47 class SuspendStateDelegate { | 49 class SuspendStateDelegate { |
48 public: | 50 public: |
49 virtual ~SuspendStateDelegate() {} | 51 virtual ~SuspendStateDelegate() {} |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 const std::string& device_path) OVERRIDE; | 104 const std::string& device_path) OVERRIDE; |
103 | 105 |
104 // chromeos::ConnectivityStateHelperObserver override. | 106 // chromeos::ConnectivityStateHelperObserver override. |
105 virtual void NetworkManagerChanged() OVERRIDE; | 107 virtual void NetworkManagerChanged() OVERRIDE; |
106 | 108 |
107 // drive::DriveServiceObserver overrides. | 109 // drive::DriveServiceObserver overrides. |
108 virtual void OnProgressUpdate( | 110 virtual void OnProgressUpdate( |
109 const google_apis::OperationProgressStatusList& list) OVERRIDE; | 111 const google_apis::OperationProgressStatusList& list) OVERRIDE; |
110 virtual void OnRefreshTokenInvalid() OVERRIDE; | 112 virtual void OnRefreshTokenInvalid() OVERRIDE; |
111 | 113 |
112 // drive::DriveFileSystemInterface::Observer overrides. | 114 // drive::DriveFileSystemObserver overrides. |
113 virtual void OnDirectoryChanged( | 115 virtual void OnDirectoryChanged( |
114 const base::FilePath& directory_path) OVERRIDE; | 116 const base::FilePath& directory_path) OVERRIDE; |
| 117 |
| 118 // drive::DriveSystemServiceObserver overrides. |
115 virtual void OnFileSystemMounted() OVERRIDE; | 119 virtual void OnFileSystemMounted() OVERRIDE; |
116 virtual void OnFileSystemBeingUnmounted() OVERRIDE; | 120 virtual void OnFileSystemBeingUnmounted() OVERRIDE; |
117 | 121 |
118 // chromeos::SystemKeyEventListener::ModifiersObserver overrides. | 122 // chromeos::SystemKeyEventListener::ModifiersObserver overrides. |
119 virtual void OnModifiersChange(int pressed_modifiers) OVERRIDE; | 123 virtual void OnModifiersChange(int pressed_modifiers) OVERRIDE; |
120 | 124 |
121 private: | 125 private: |
122 typedef std::map<std::string, int> ExtensionUsageRegistry; | 126 typedef std::map<std::string, int> ExtensionUsageRegistry; |
123 | 127 |
124 // This class is used to remember what extensions are watching |virtual_path|. | 128 // This class is used to remember what extensions are watching |virtual_path|. |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 Profile* profile_; | 222 Profile* profile_; |
219 | 223 |
220 // Event router behavior depends on shift modifier status. This is designed | 224 // Event router behavior depends on shift modifier status. This is designed |
221 // for power users. | 225 // for power users. |
222 bool shift_pressed_; | 226 bool shift_pressed_; |
223 | 227 |
224 DISALLOW_COPY_AND_ASSIGN(FileManagerEventRouter); | 228 DISALLOW_COPY_AND_ASSIGN(FileManagerEventRouter); |
225 }; | 229 }; |
226 | 230 |
227 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_EVENT_RO
UTER_H_ | 231 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_FILE_MANAGER_EVENT_RO
UTER_H_ |
OLD | NEW |