Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / extensions / file_manager / event_router.h
index 8be34a1..7a90bcd 100644 (file)
@@ -18,6 +18,7 @@
 #include "chrome/browser/chromeos/drive/sync_client.h"
 #include "chrome/browser/chromeos/file_manager/file_watcher.h"
 #include "chrome/browser/chromeos/file_manager/fileapi_util.h"
+#include "chrome/browser/chromeos/file_manager/volume_manager.h"
 #include "chrome/browser/chromeos/file_manager/volume_manager_observer.h"
 #include "chrome/browser/drive/drive_service_interface.h"
 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h"
@@ -41,6 +42,10 @@ namespace chromeos {
 class NetworkState;
 }
 
+namespace drive {
+class FileChange;
+}
+
 namespace file_manager {
 
 // Monitors changes in disk mounts, network connection state and preferences
@@ -108,6 +113,7 @@ class EventRouter
 
   // drive::FileSystemObserver overrides.
   virtual void OnDirectoryChanged(const base::FilePath& drive_path) OVERRIDE;
+  virtual void OnFileChanged(const drive::FileChange& changed_files) OVERRIDE;
   virtual void OnDriveSyncError(drive::file_system::DriveSyncErrorType type,
                                 const base::FilePath& drive_path) OVERRIDE;
 
@@ -124,6 +130,7 @@ class EventRouter
                                bool is_remounting) OVERRIDE;
   virtual void OnVolumeUnmounted(chromeos::MountError error_code,
                                  const VolumeInfo& volume_info) OVERRIDE;
+  virtual void OnHardUnplugged(const std::string& device_path) OVERRIDE;
   virtual void OnFormatStarted(
       const std::string& device_path, bool success) OVERRIDE;
   virtual void OnFormatCompleted(
@@ -144,25 +151,37 @@ class EventRouter
   void OnFileManagerPrefsChanged();
 
   // Process file watch notifications.
-  void HandleFileWatchNotification(const base::FilePath& path,
+  void HandleFileWatchNotification(const drive::FileChange* list,
+                                   const base::FilePath& path,
                                    bool got_error);
 
   // Sends directory change event.
   void DispatchDirectoryChangeEvent(
       const base::FilePath& path,
-      bool error,
+      const drive::FileChange* list,
+      bool got_error,
       const std::vector<std::string>& extension_ids);
 
   // Sends directory change event, after converting the file definition to entry
   // definition.
   void DispatchDirectoryChangeEventWithEntryDefinition(
+      const linked_ptr<drive::FileChange> list,
+      const std::string* extension_id,
       bool watcher_error,
       const EntryDefinition& entry_definition);
 
+  // Dispatches the mount completed event.
+  void DispatchMountCompletedEvent(
+      extensions::api::file_browser_private::MountCompletedEventType event_type,
+      chromeos::MountError error,
+      const VolumeInfo& volume_info,
+      bool is_remounting);
+
   // If needed, opens a file manager window for the removable device mounted at
   // |mount_path|. Disk.mount_path() is empty, since it is being filled out
   // after calling notifying observers by DiskMountManager.
-  void ShowRemovableDeviceInFileManager(const base::FilePath& mount_path);
+  void ShowRemovableDeviceInFileManager(VolumeType type,
+                                        const base::FilePath& mount_path);
 
   // Dispatches an onDeviceChanged event containing |type| and |path| to
   // extensions.
@@ -185,6 +204,7 @@ class EventRouter
   };
   std::map<drive::JobID, DriveJobInfoWithStatus> drive_jobs_;
   base::Time last_file_transfer_event_;
+  base::Time last_copy_progress_event_;
 
   WatcherMap file_watchers_;
   scoped_ptr<PrefChangeRegistrar> pref_change_registrar_;