OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "ash/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
6 #include "ash/caps_lock_delegate.h" | 6 #include "ash/caps_lock_delegate.h" |
7 #include "ash/ime_control_delegate.h" | 7 #include "ash/ime_control_delegate.h" |
8 #include "ash/screenshot_delegate.h" | 8 #include "ash/screenshot_delegate.h" |
9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/shell_window_ids.h" | 10 #include "ash/shell_window_ids.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 | 119 |
120 DISALLOW_COPY_AND_ASSIGN(DummyCapsLockDelegate); | 120 DISALLOW_COPY_AND_ASSIGN(DummyCapsLockDelegate); |
121 }; | 121 }; |
122 | 122 |
123 class DummyVolumeControlDelegate : public VolumeControlDelegate { | 123 class DummyVolumeControlDelegate : public VolumeControlDelegate { |
124 public: | 124 public: |
125 explicit DummyVolumeControlDelegate(bool consume) | 125 explicit DummyVolumeControlDelegate(bool consume) |
126 : consume_(consume), | 126 : consume_(consume), |
127 handle_volume_mute_count_(0), | 127 handle_volume_mute_count_(0), |
128 handle_volume_down_count_(0), | 128 handle_volume_down_count_(0), |
129 handle_volume_up_count_(0) { | 129 handle_volume_up_count_(0){ |
130 } | 130 } |
131 virtual ~DummyVolumeControlDelegate() {} | 131 virtual ~DummyVolumeControlDelegate() {} |
132 | 132 |
133 virtual bool HandleVolumeMute(const ui::Accelerator& accelerator) OVERRIDE { | 133 virtual bool HandleVolumeMute(const ui::Accelerator& accelerator) OVERRIDE { |
134 ++handle_volume_mute_count_; | 134 ++handle_volume_mute_count_; |
135 last_accelerator_ = accelerator; | 135 last_accelerator_ = accelerator; |
136 return consume_; | 136 return consume_; |
137 } | 137 } |
138 virtual bool HandleVolumeDown(const ui::Accelerator& accelerator) OVERRIDE { | 138 virtual bool HandleVolumeDown(const ui::Accelerator& accelerator) OVERRIDE { |
139 ++handle_volume_down_count_; | 139 ++handle_volume_down_count_; |
140 last_accelerator_ = accelerator; | 140 last_accelerator_ = accelerator; |
141 return consume_; | 141 return consume_; |
142 } | 142 } |
143 virtual bool HandleVolumeUp(const ui::Accelerator& accelerator) OVERRIDE { | 143 virtual bool HandleVolumeUp(const ui::Accelerator& accelerator) OVERRIDE { |
144 ++handle_volume_up_count_; | 144 ++handle_volume_up_count_; |
145 last_accelerator_ = accelerator; | 145 last_accelerator_ = accelerator; |
146 return consume_; | 146 return consume_; |
147 } | 147 } |
| 148 virtual void SetVolumePercent(double percent) OVERRIDE { |
| 149 } |
148 | 150 |
149 int handle_volume_mute_count() const { | 151 int handle_volume_mute_count() const { |
150 return handle_volume_mute_count_; | 152 return handle_volume_mute_count_; |
151 } | 153 } |
152 int handle_volume_down_count() const { | 154 int handle_volume_down_count() const { |
153 return handle_volume_down_count_; | 155 return handle_volume_down_count_; |
154 } | 156 } |
155 int handle_volume_up_count() const { | 157 int handle_volume_up_count() const { |
156 return handle_volume_up_count_; | 158 return handle_volume_up_count_; |
157 } | 159 } |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
733 EXPECT_FALSE(GetController()->Process(shift_alt_press)); | 735 EXPECT_FALSE(GetController()->Process(shift_alt_press)); |
734 EXPECT_FALSE(GetController()->Process(shift_alt_x_press)); | 736 EXPECT_FALSE(GetController()->Process(shift_alt_x_press)); |
735 EXPECT_FALSE(GetController()->Process(shift_alt_x)); | 737 EXPECT_FALSE(GetController()->Process(shift_alt_x)); |
736 EXPECT_FALSE(GetController()->Process(shift_alt)); | 738 EXPECT_FALSE(GetController()->Process(shift_alt)); |
737 EXPECT_EQ(2, delegate->handle_next_ime_count()); | 739 EXPECT_EQ(2, delegate->handle_next_ime_count()); |
738 } | 740 } |
739 } | 741 } |
740 | 742 |
741 } // namespace test | 743 } // namespace test |
742 } // namespace ash | 744 } // namespace ash |
OLD | NEW |