blob: ee1cfe1b1f87c823ed4a5df2c9d77751d6c5714b [file] [log] [blame]
[email protected]93e828f2014-05-14 14:08:111// 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
avidb567a8a2015-12-20 17:07:248#include "base/macros.h"
[email protected]93e828f2014-05-14 14:08:119#include "ui/views/test/test_views_delegate.h"
10
11namespace ash {
[email protected]93e828f2014-05-14 14:08:1112
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.
16class AshTestViewsDelegate : public views::TestViewsDelegate {
17 public:
18 AshTestViewsDelegate();
dcheng0b8c9d7f2014-10-28 00:21:1019 ~AshTestViewsDelegate() override;
[email protected]93e828f2014-05-14 14:08:1120
21 // Overriden from TestViewsDelegate.
dcheng0b8c9d7f2014-10-28 00:21:1022 void OnBeforeWidgetInit(
[email protected]93e828f2014-05-14 14:08:1123 views::Widget::InitParams* params,
mostynb10d6b382014-10-03 16:23:4524 views::internal::NativeWidgetDelegate* delegate) override;
Yuki Awano6bef6b212017-09-06 02:53:2125 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]93e828f2014-05-14 14:08:1132
33 private:
Yuki Awano6bef6b212017-09-06 02:53:2134 // ProcessAcceleratorWhileMenuShowing returns CLOSE_MENU if passed accelerator
35 // matches with this.
36 ui::Accelerator close_menu_accelerator_;
37
[email protected]93e828f2014-05-14 14:08:1138 DISALLOW_COPY_AND_ASSIGN(AshTestViewsDelegate);
39};
40
[email protected]93e828f2014-05-14 14:08:1141} // namespace ash
42
43#endif // ASH_TEST_ASH_TEST_VIEWS_DELEGATE_H_