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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
16 #include "base/files/file_path_watcher.h" | 16 #include "base/files/file_path_watcher.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 18 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
19 #include "chrome/browser/chromeos/extensions/file_manager/device_event_router.h" | 19 #include "chrome/browser/chromeos/extensions/file_manager/device_event_router.h" |
20 #include "chrome/browser/chromeos/extensions/file_manager/job_event_router.h" | 20 #include "chrome/browser/chromeos/extensions/file_manager/job_event_router.h" |
21 #include "chrome/browser/chromeos/file_manager/file_watcher.h" | 21 #include "chrome/browser/chromeos/file_manager/file_watcher.h" |
22 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" | 22 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" |
23 #include "chrome/browser/chromeos/file_manager/volume_manager.h" | 23 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
24 #include "chrome/browser/chromeos/file_manager/volume_manager_observer.h" | 24 #include "chrome/browser/chromeos/file_manager/volume_manager_observer.h" |
25 #include "chrome/common/extensions/api/file_manager_private.h" | 25 #include "chrome/common/extensions/api/file_manager_private.h" |
26 #include "chromeos/disks/disk_mount_manager.h" | 26 #include "chromeos/disks/disk_mount_manager.h" |
27 #include "chromeos/network/network_state_handler_observer.h" | 27 #include "chromeos/network/network_state_handler_observer.h" |
28 #include "chromeos/settings/timezone_settings.h" | 28 #include "chromeos/settings/timezone_settings.h" |
| 29 #include "components/arc/intent_helper/arc_intent_helper_bridge.h" |
29 #include "components/drive/chromeos/file_system_observer.h" | 30 #include "components/drive/chromeos/file_system_observer.h" |
30 #include "components/drive/chromeos/sync_client.h" | 31 #include "components/drive/chromeos/sync_client.h" |
31 #include "components/drive/service/drive_service_interface.h" | 32 #include "components/drive/service/drive_service_interface.h" |
32 #include "components/keyed_service/core/keyed_service.h" | 33 #include "components/keyed_service/core/keyed_service.h" |
33 #include "storage/browser/fileapi/file_system_operation.h" | 34 #include "storage/browser/fileapi/file_system_operation.h" |
34 | 35 |
35 class PrefChangeRegistrar; | 36 class PrefChangeRegistrar; |
36 class Profile; | 37 class Profile; |
37 | 38 |
38 using file_manager::util::EntryDefinition; | 39 using file_manager::util::EntryDefinition; |
(...skipping 12 matching lines...) Expand all Loading... |
51 | 52 |
52 namespace file_manager { | 53 namespace file_manager { |
53 | 54 |
54 // Monitors changes in disk mounts, network connection state and preferences | 55 // Monitors changes in disk mounts, network connection state and preferences |
55 // affecting File Manager. Dispatches appropriate File Browser events. | 56 // affecting File Manager. Dispatches appropriate File Browser events. |
56 class EventRouter : public KeyedService, | 57 class EventRouter : public KeyedService, |
57 public chromeos::NetworkStateHandlerObserver, | 58 public chromeos::NetworkStateHandlerObserver, |
58 public chromeos::system::TimezoneSettings::Observer, | 59 public chromeos::system::TimezoneSettings::Observer, |
59 public drive::FileSystemObserver, | 60 public drive::FileSystemObserver, |
60 public drive::DriveServiceObserver, | 61 public drive::DriveServiceObserver, |
61 public VolumeManagerObserver { | 62 public VolumeManagerObserver, |
| 63 public arc::ArcIntentHelperBridge::Observer { |
62 public: | 64 public: |
63 typedef base::Callback<void(const base::FilePath& virtual_path, | 65 typedef base::Callback<void(const base::FilePath& virtual_path, |
64 const drive::FileChange* list, | 66 const drive::FileChange* list, |
65 bool got_error, | 67 bool got_error, |
66 const std::vector<std::string>& extension_ids)> | 68 const std::vector<std::string>& extension_ids)> |
67 DispatchDirectoryChangeEventImplCallback; | 69 DispatchDirectoryChangeEventImplCallback; |
68 | 70 |
69 explicit EventRouter(Profile* profile); | 71 explicit EventRouter(Profile* profile); |
70 ~EventRouter() override; | 72 ~EventRouter() override; |
71 | 73 |
| 74 // arc::ArcIntentHelperBridge::Observer overrides. |
| 75 void OnAppsUpdated() override; |
| 76 |
72 // KeyedService overrides. | 77 // KeyedService overrides. |
73 void Shutdown() override; | 78 void Shutdown() override; |
74 | 79 |
75 typedef base::Callback<void(bool success)> BoolCallback; | 80 typedef base::Callback<void(bool success)> BoolCallback; |
76 | 81 |
77 // Adds a file watch at |local_path|, associated with |virtual_path|, for | 82 // Adds a file watch at |local_path|, associated with |virtual_path|, for |
78 // an extension with |extension_id|. | 83 // an extension with |extension_id|. |
79 // | 84 // |
80 // |callback| will be called with true on success, or false on failure. | 85 // |callback| will be called with true on success, or false on failure. |
81 // |callback| must not be null. | 86 // |callback| must not be null. |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 // Note: This should remain the last member so it'll be destroyed and | 230 // Note: This should remain the last member so it'll be destroyed and |
226 // invalidate the weak pointers before any other members are destroyed. | 231 // invalidate the weak pointers before any other members are destroyed. |
227 base::WeakPtrFactory<EventRouter> weak_factory_; | 232 base::WeakPtrFactory<EventRouter> weak_factory_; |
228 | 233 |
229 DISALLOW_COPY_AND_ASSIGN(EventRouter); | 234 DISALLOW_COPY_AND_ASSIGN(EventRouter); |
230 }; | 235 }; |
231 | 236 |
232 } // namespace file_manager | 237 } // namespace file_manager |
233 | 238 |
234 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ | 239 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ |
OLD | NEW |