1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_OBSERVER_H_
6 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_OBSERVER_H_
10 #include "chromeos/dbus/cros_disks_client.h"
11 #include "chromeos/disks/disk_mount_manager.h"
13 namespace file_manager
{
17 // Observer interface of volume related events.
18 class VolumeManagerObserver
{
20 virtual ~VolumeManagerObserver() {}
22 // Fired when a new disk is added.
23 virtual void OnDiskAdded(
24 const chromeos::disks::DiskMountManager::Disk
& disk
, bool mounting
) = 0;
26 // Fired when a disk is removed.
27 virtual void OnDiskRemoved(
28 const chromeos::disks::DiskMountManager::Disk
& disk
) = 0;
30 // Fired when a new device is added.
31 virtual void OnDeviceAdded(const std::string
& device_path
) = 0;
33 // Fired when a device is removed.
34 virtual void OnDeviceRemoved(const std::string
& device_path
) = 0;
36 // Fired when a volume is mounted.
37 virtual void OnVolumeMounted(chromeos::MountError error_code
,
38 const VolumeInfo
& volume_info
,
39 bool is_remounting
) = 0;
41 // Fired when a volume is unmounted.
42 virtual void OnVolumeUnmounted(chromeos::MountError error_code
,
43 const VolumeInfo
& volume_info
) = 0;
45 // Fired when formatting a device is started (or failed to start).
46 virtual void OnFormatStarted(
47 const std::string
& device_path
, bool success
) = 0;
49 // Fired when formatting a device is completed (or terminated on error).
50 virtual void OnFormatCompleted(
51 const std::string
& device_path
, bool success
) = 0;
54 } // namespace file_manager
56 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_VOLUME_MANAGER_OBSERVER_H_