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