OLD | NEW |
| (Empty) |
1 // Copyright 2016 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 ASH_COMMON_TEST_TEST_PALETTE_DELEGATE_H_ | |
6 #define ASH_COMMON_TEST_TEST_PALETTE_DELEGATE_H_ | |
7 | |
8 #include "ash/common/palette_delegate.h" | |
9 #include "base/macros.h" | |
10 | |
11 namespace ash { | |
12 | |
13 // A simple test double for a PaletteDelegate. | |
14 class TestPaletteDelegate : public PaletteDelegate { | |
15 public: | |
16 TestPaletteDelegate(); | |
17 ~TestPaletteDelegate() override; | |
18 | |
19 int create_note_count() const { return create_note_count_; } | |
20 | |
21 int has_note_app_count() const { return has_note_app_count_; } | |
22 | |
23 int take_screenshot_count() const { return take_screenshot_count_; } | |
24 | |
25 int take_partial_screenshot_count() const { | |
26 return take_partial_screenshot_count_; | |
27 } | |
28 | |
29 base::Closure partial_screenshot_done() const { | |
30 return partial_screenshot_done_; | |
31 } | |
32 | |
33 void set_has_note_app(bool has_note_app) { has_note_app_ = has_note_app; } | |
34 | |
35 void set_should_auto_open_palette(bool should_auto_open_palette) { | |
36 should_auto_open_palette_ = should_auto_open_palette; | |
37 } | |
38 | |
39 void set_should_show_palette(bool should_show_palette) { | |
40 should_show_palette_ = should_show_palette; | |
41 } | |
42 | |
43 private: | |
44 // PaletteDelegate: | |
45 std::unique_ptr<EnableListenerSubscription> AddPaletteEnableListener( | |
46 const EnableListener& on_state_changed) override; | |
47 void CreateNote() override; | |
48 bool HasNoteApp() override; | |
49 bool ShouldAutoOpenPalette() override; | |
50 bool ShouldShowPalette() override; | |
51 void TakeScreenshot() override; | |
52 void TakePartialScreenshot(const base::Closure& done) override; | |
53 void CancelPartialScreenshot() override; | |
54 | |
55 int create_note_count_ = 0; | |
56 int has_note_app_count_ = 0; | |
57 int take_screenshot_count_ = 0; | |
58 int take_partial_screenshot_count_ = 0; | |
59 base::Closure partial_screenshot_done_; | |
60 bool has_note_app_ = false; | |
61 bool should_auto_open_palette_ = false; | |
62 bool should_show_palette_ = false; | |
63 | |
64 DISALLOW_COPY_AND_ASSIGN(TestPaletteDelegate); | |
65 }; | |
66 | |
67 } // namespace ash | |
68 | |
69 #endif // ASH_COMMON_TEST_TEST_PALETTE_DELEGATE_H_ | |
OLD | NEW |