[email protected] | 93e828f | 2014-05-14 14:08:11 | [diff] [blame] | 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 ASH_TEST_ASH_TEST_VIEWS_DELEGATE_H_ | ||||
6 | #define ASH_TEST_ASH_TEST_VIEWS_DELEGATE_H_ | ||||
7 | |||||
avi | db567a8a | 2015-12-20 17:07:24 | [diff] [blame] | 8 | #include "base/macros.h" |
[email protected] | 93e828f | 2014-05-14 14:08:11 | [diff] [blame] | 9 | #include "ui/views/test/test_views_delegate.h" |
10 | |||||
11 | namespace ash { | ||||
[email protected] | 93e828f | 2014-05-14 14:08:11 | [diff] [blame] | 12 | |
13 | // Ash specific ViewsDelegate. In addition to creating a TestWebContents this | ||||
14 | // parents widget with no parent/context to the shell. This is created by | ||||
15 | // default AshTestHelper. | ||||
16 | class AshTestViewsDelegate : public views::TestViewsDelegate { | ||||
17 | public: | ||||
18 | AshTestViewsDelegate(); | ||||
dcheng | 0b8c9d7f | 2014-10-28 00:21:10 | [diff] [blame] | 19 | ~AshTestViewsDelegate() override; |
[email protected] | 93e828f | 2014-05-14 14:08:11 | [diff] [blame] | 20 | |
21 | // Overriden from TestViewsDelegate. | ||||
dcheng | 0b8c9d7f | 2014-10-28 00:21:10 | [diff] [blame] | 22 | void OnBeforeWidgetInit( |
[email protected] | 93e828f | 2014-05-14 14:08:11 | [diff] [blame] | 23 | views::Widget::InitParams* params, |
mostynb | 10d6b38 | 2014-10-03 16:23:45 | [diff] [blame] | 24 | views::internal::NativeWidgetDelegate* delegate) override; |
Yuki Awano | 6bef6b21 | 2017-09-06 02:53:21 | [diff] [blame] | 25 | views::TestViewsDelegate::ProcessMenuAcceleratorResult |
26 | ProcessAcceleratorWhileMenuShowing( | ||||
27 | const ui::Accelerator& accelerator) override; | ||||
28 | |||||
29 | void set_close_menu_accelerator(const ui::Accelerator& accelerator) { | ||||
30 | close_menu_accelerator_ = accelerator; | ||||
31 | } | ||||
[email protected] | 93e828f | 2014-05-14 14:08:11 | [diff] [blame] | 32 | |
33 | private: | ||||
Yuki Awano | 6bef6b21 | 2017-09-06 02:53:21 | [diff] [blame] | 34 | // ProcessAcceleratorWhileMenuShowing returns CLOSE_MENU if passed accelerator |
35 | // matches with this. | ||||
36 | ui::Accelerator close_menu_accelerator_; | ||||
37 | |||||
[email protected] | 93e828f | 2014-05-14 14:08:11 | [diff] [blame] | 38 | DISALLOW_COPY_AND_ASSIGN(AshTestViewsDelegate); |
39 | }; | ||||
40 | |||||
[email protected] | 93e828f | 2014-05-14 14:08:11 | [diff] [blame] | 41 | } // namespace ash |
42 | |||||
43 | #endif // ASH_TEST_ASH_TEST_VIEWS_DELEGATE_H_ |