summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/file_system_provider/observer.h
blob: 104d4cfd7469f65fe934976142649ba10eb9af8d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OBSERVER_H_
#define CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OBSERVER_H_

#include <string>

#include "base/files/file.h"

namespace chromeos {
namespace file_system_provider {

class ProvidedFileSystemInfo;

// Context for mounting. Whether happened due to user interaction or after
// a reboot, when restoring.
enum MountContext { MOUNT_CONTEXT_USER, MOUNT_CONTEXT_RESTORE };

// Observes file_system_provider::Service for mounting and unmounting events.
class Observer {
 public:
  virtual ~Observer() {}

  // Called when a file system mounting has been invoked. For success, the
  // |error| argument is set to FILE_OK. Otherwise, |error| contains a specific
  // error code.
  virtual void OnProvidedFileSystemMount(
      const ProvidedFileSystemInfo& file_system_info,
      MountContext context,
      base::File::Error error) = 0;

  // Called when a file system unmounting has been invoked. For success, the
  // |error| argument is set to FILE_OK. Otherwise, |error| contains a specific
  // error code.
  virtual void OnProvidedFileSystemUnmount(
      const ProvidedFileSystemInfo& file_system_info,
      base::File::Error error) = 0;
};

}  // namespace file_system_provider
}  // namespace chromeos

#endif  // CHROME_BROWSER_CHROMEOS_FILE_SYSTEM_PROVIDER_OBSERVER_H_