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. 4 5 #ifndef COMPONENTS_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ 6 #define COMPONENTS_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ 7 8 #include "components/storage_monitor/removable_storage_observer.h" 9 #include "components/storage_monitor/storage_info.h" 10 11 namespace storage_monitor { 12 13 class MockRemovableStorageObserver : public RemovableStorageObserver { 14 public: 15 MockRemovableStorageObserver(); 16 virtual ~MockRemovableStorageObserver(); 17 18 virtual void OnRemovableStorageAttached(const StorageInfo& info) OVERRIDE; 19 20 virtual void OnRemovableStorageDetached(const StorageInfo& info) OVERRIDE; 21 22 int attach_calls() { return attach_calls_; } 23 24 int detach_calls() { return detach_calls_; } 25 26 const StorageInfo& last_attached() { 27 return last_attached_; 28 } 29 30 const StorageInfo& last_detached() { 31 return last_detached_; 32 } 33 34 private: 35 int attach_calls_; 36 int detach_calls_; 37 StorageInfo last_attached_; 38 StorageInfo last_detached_; 39 }; 40 41 } // namespace storage_monitor 42 43 #endif // COMPONENTS_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ 44