| 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/files/file_path_watcher.h" | 13 #include "base/files/file_path_watcher.h" |
| 14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
| 15 #include "chrome/browser/chromeos/drive/drive_integration_service.h" | 15 #include "chrome/browser/chromeos/drive/drive_integration_service.h" |
| 16 #include "chrome/browser/chromeos/drive/file_system_observer.h" | 16 #include "chrome/browser/chromeos/drive/file_system_observer.h" |
| 17 #include "chrome/browser/chromeos/drive/job_list.h" | 17 #include "chrome/browser/chromeos/drive/job_list.h" |
| 18 #include "chrome/browser/chromeos/drive/sync_client.h" | 18 #include "chrome/browser/chromeos/drive/sync_client.h" |
| 19 #include "chrome/browser/chromeos/file_manager/file_watcher.h" | 19 #include "chrome/browser/chromeos/file_manager/file_watcher.h" |
| 20 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" | 20 #include "chrome/browser/chromeos/file_manager/fileapi_util.h" |
| 21 #include "chrome/browser/chromeos/file_manager/volume_manager.h" |
| 21 #include "chrome/browser/chromeos/file_manager/volume_manager_observer.h" | 22 #include "chrome/browser/chromeos/file_manager/volume_manager_observer.h" |
| 22 #include "chrome/browser/drive/drive_service_interface.h" | 23 #include "chrome/browser/drive/drive_service_interface.h" |
| 23 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 24 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
| 24 #include "chrome/common/extensions/api/file_browser_private.h" | 25 #include "chrome/common/extensions/api/file_browser_private.h" |
| 25 #include "chromeos/disks/disk_mount_manager.h" | 26 #include "chromeos/disks/disk_mount_manager.h" |
| 26 #include "chromeos/network/network_state_handler_observer.h" | 27 #include "chromeos/network/network_state_handler_observer.h" |
| 27 #include "content/public/browser/notification_observer.h" | 28 #include "content/public/browser/notification_observer.h" |
| 28 #include "content/public/browser/notification_registrar.h" | 29 #include "content/public/browser/notification_registrar.h" |
| 29 #include "webkit/browser/fileapi/file_system_operation.h" | 30 #include "webkit/browser/fileapi/file_system_operation.h" |
| 30 | 31 |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 157 |
| 157 // Sends directory change event, after converting the file definition to entry | 158 // Sends directory change event, after converting the file definition to entry |
| 158 // definition. | 159 // definition. |
| 159 void DispatchDirectoryChangeEventWithEntryDefinition( | 160 void DispatchDirectoryChangeEventWithEntryDefinition( |
| 160 bool watcher_error, | 161 bool watcher_error, |
| 161 const EntryDefinition& entry_definition); | 162 const EntryDefinition& entry_definition); |
| 162 | 163 |
| 163 // If needed, opens a file manager window for the removable device mounted at | 164 // If needed, opens a file manager window for the removable device mounted at |
| 164 // |mount_path|. Disk.mount_path() is empty, since it is being filled out | 165 // |mount_path|. Disk.mount_path() is empty, since it is being filled out |
| 165 // after calling notifying observers by DiskMountManager. | 166 // after calling notifying observers by DiskMountManager. |
| 166 void ShowRemovableDeviceInFileManager(const base::FilePath& mount_path); | 167 void ShowRemovableDeviceInFileManager(VolumeType type, |
| 168 const base::FilePath& mount_path); |
| 167 | 169 |
| 168 // Dispatches an onDeviceChanged event containing |type| and |path| to | 170 // Dispatches an onDeviceChanged event containing |type| and |path| to |
| 169 // extensions. | 171 // extensions. |
| 170 void DispatchDeviceEvent( | 172 void DispatchDeviceEvent( |
| 171 extensions::api::file_browser_private::DeviceEventType type, | 173 extensions::api::file_browser_private::DeviceEventType type, |
| 172 const std::string& path); | 174 const std::string& path); |
| 173 | 175 |
| 174 // Sends onFileTranferUpdated to extensions if needed. If |always| is true, | 176 // Sends onFileTranferUpdated to extensions if needed. If |always| is true, |
| 175 // it sends the event always. Otherwise, it sends the event if enough time has | 177 // it sends the event always. Otherwise, it sends the event if enough time has |
| 176 // passed from the previous event so as not to make extension busy. | 178 // passed from the previous event so as not to make extension busy. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 197 | 199 |
| 198 // Note: This should remain the last member so it'll be destroyed and | 200 // Note: This should remain the last member so it'll be destroyed and |
| 199 // invalidate the weak pointers before any other members are destroyed. | 201 // invalidate the weak pointers before any other members are destroyed. |
| 200 base::WeakPtrFactory<EventRouter> weak_factory_; | 202 base::WeakPtrFactory<EventRouter> weak_factory_; |
| 201 DISALLOW_COPY_AND_ASSIGN(EventRouter); | 203 DISALLOW_COPY_AND_ASSIGN(EventRouter); |
| 202 }; | 204 }; |
| 203 | 205 |
| 204 } // namespace file_manager | 206 } // namespace file_manager |
| 205 | 207 |
| 206 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ | 208 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_FILE_MANAGER_EVENT_ROUTER_H_ |
| OLD | NEW |