OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ |
6 #define CHROME_BROWSER_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ | 6 #define CHROME_BROWSER_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ |
7 | 7 |
8 #include "chrome/browser/storage_monitor/removable_storage_observer.h" | 8 #include "chrome/browser/storage_monitor/removable_storage_observer.h" |
9 #include "chrome/browser/storage_monitor/storage_info.h" | 9 #include "chrome/browser/storage_monitor/storage_info.h" |
10 | 10 |
11 namespace chrome { | |
12 | |
13 class MockRemovableStorageObserver : public RemovableStorageObserver { | 11 class MockRemovableStorageObserver : public RemovableStorageObserver { |
14 public: | 12 public: |
15 MockRemovableStorageObserver(); | 13 MockRemovableStorageObserver(); |
16 virtual ~MockRemovableStorageObserver(); | 14 virtual ~MockRemovableStorageObserver(); |
17 | 15 |
18 virtual void OnRemovableStorageAttached(const StorageInfo& info) OVERRIDE; | 16 virtual void OnRemovableStorageAttached(const StorageInfo& info) OVERRIDE; |
19 | 17 |
20 virtual void OnRemovableStorageDetached(const StorageInfo& info) OVERRIDE; | 18 virtual void OnRemovableStorageDetached(const StorageInfo& info) OVERRIDE; |
21 | 19 |
22 int attach_calls() { return attach_calls_; } | 20 int attach_calls() { return attach_calls_; } |
23 | 21 |
24 int detach_calls() { return detach_calls_; } | 22 int detach_calls() { return detach_calls_; } |
25 | 23 |
26 const StorageInfo& last_attached() { | 24 const StorageInfo& last_attached() { |
27 return last_attached_; | 25 return last_attached_; |
28 } | 26 } |
29 | 27 |
30 const StorageInfo& last_detached() { | 28 const StorageInfo& last_detached() { |
31 return last_detached_; | 29 return last_detached_; |
32 } | 30 } |
33 | 31 |
34 private: | 32 private: |
35 int attach_calls_; | 33 int attach_calls_; |
36 int detach_calls_; | 34 int detach_calls_; |
37 StorageInfo last_attached_; | 35 StorageInfo last_attached_; |
38 StorageInfo last_detached_; | 36 StorageInfo last_detached_; |
39 }; | 37 }; |
40 | 38 |
41 } // namespace chrome | |
42 | |
43 #endif // CHROME_BROWSER_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ | 39 #endif // CHROME_BROWSER_STORAGE_MONITOR_MOCK_REMOVABLE_STORAGE_OBSERVER_H_ |
OLD | NEW |