Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / chromeos / file_manager / volume_manager.h
index de8f28b..da3b2e7 100644 (file)
@@ -14,6 +14,7 @@
 #include "base/observer_list.h"
 #include "base/prefs/pref_change_registrar.h"
 #include "chrome/browser/chromeos/drive/drive_integration_service.h"
+#include "chrome/browser/local_discovery/storage/privet_volume_lister.h"
 #include "chromeos/dbus/cros_disks_client.h"
 #include "chromeos/disks/disk_mount_manager.h"
 #include "components/browser_context_keyed_service/browser_context_keyed_service.h"
@@ -129,6 +130,9 @@ class VolumeManager : public BrowserContextKeyedService,
   bool FindVolumeInfoById(const std::string& volume_id,
                           VolumeInfo* result) const;
 
+  // For testing purpose, adds the custom |path| as the "Downloads" folder.
+  bool RegisterDownloadsDirectoryForTesting(const base::FilePath& path);
+
   // drive::DriveIntegrationServiceObserver overrides.
   virtual void OnFileSystemMounted() OVERRIDE;
   virtual void OnFileSystemBeingUnmounted() OVERRIDE;
@@ -154,12 +158,24 @@ class VolumeManager : public BrowserContextKeyedService,
   void OnExternalStorageDisabledChanged();
 
  private:
+  void OnPrivetVolumesAvailable(
+      const local_discovery::PrivetVolumeLister::VolumeList& volumes);
+  void DoMountEvent(chromeos::MountError error_code,
+                    const VolumeInfo& volume_info,
+                    bool is_remounting);
+  void DoUnmountEvent(chromeos::MountError error_code,
+                      const VolumeInfo& volume_info);
+
   Profile* profile_;
   drive::DriveIntegrationService* drive_integration_service_;
   chromeos::disks::DiskMountManager* disk_mount_manager_;
   scoped_ptr<MountedDiskMonitor> mounted_disk_monitor_;
   PrefChangeRegistrar pref_change_registrar_;
   ObserverList<VolumeManagerObserver> observers_;
+  scoped_ptr<local_discovery::PrivetVolumeLister> privet_volume_lister_;
+
+  std::map<std::string, VolumeInfo> mounted_volumes_;
+
   DISALLOW_COPY_AND_ASSIGN(VolumeManager);
 };