Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / components / storage_monitor / mock_removable_storage_observer.h
blob14fde61e68f8217456e34e2589f0a3d2c02bede5
1 // Copyright 2014 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 COMPONENTS_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_
6 #define COMPONENTS_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_
8 #include "components/storage_monitor/removable_storage_observer.h"
9 #include "components/storage_monitor/storage_info.h"
11 namespace storage_monitor {
13 class MockRemovableStorageObserver : public RemovableStorageObserver {
14 public:
15 MockRemovableStorageObserver();
16 ~MockRemovableStorageObserver() override;
18 void OnRemovableStorageAttached(const StorageInfo& info) override;
20 void OnRemovableStorageDetached(const StorageInfo& info) override;
22 int attach_calls() { return attach_calls_; }
24 int detach_calls() { return detach_calls_; }
26 const StorageInfo& last_attached() {
27 return last_attached_;
30 const StorageInfo& last_detached() {
31 return last_detached_;
34 private:
35 int attach_calls_;
36 int detach_calls_;
37 StorageInfo last_attached_;
38 StorageInfo last_detached_;
41 } // namespace storage_monitor
43 #endif // COMPONENTS_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_