summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/drive/drive_file_system_observer.h
blob: a97f33839de48f998b2c06c5bfb7b0a5d826b97b (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
46
47
48
49
50
51
52
// Copyright (c) 2012 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_DRIVE_DRIVE_FILE_SYSTEM_OBSERVER_H_
#define CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_OBSERVER_H_

#include "chrome/browser/chromeos/drive/drive_file_error.h"

class FilePath;

namespace drive {

// Interface for classes that need to observe events from classes implementing
// DriveFileSystemInterface.
// All events are notified on UI thread.
class DriveFileSystemObserver {
 public:
  // Triggered when a content of a directory has been changed.
  // |directory_path| is a virtual directory path (/drive/...) representing
  // changed directory.
  virtual void OnDirectoryChanged(const FilePath& directory_path) {
  }

  // Triggered when the file system is initially loaded.
  virtual void OnInitialLoadFinished(DriveFileError error) {
  }

  // Triggered when a document feed is fetched. |num_accumulated_entries|
  // tells the number of entries fetched so far.
  virtual void OnDocumentFeedFetched(int num_accumulated_entries) {
  }

  // Triggered when the feed from the server is loaded.
  virtual void OnFeedFromServerLoaded() {
  }

  // Triggered when the file system is mounted.
  virtual void OnFileSystemMounted() {
  }

  // Triggered when the file system is being unmounted.
  virtual void OnFileSystemBeingUnmounted() {
  }

 protected:
  virtual ~DriveFileSystemObserver() {}
};

}  // namespace drive

#endif  // CHROME_BROWSER_CHROMEOS_DRIVE_DRIVE_FILE_SYSTEM_OBSERVER_H_