Switch global error menu icon to vectorized MD asset
[chromium-blink-merge.git] / ash / test / child_modal_window.h
blobf0c6f014adf85cf90009edebde049b40a6265fb2
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.
5 #ifndef ASH_TEST_CHILD_MODAL_WINDOW_H_
6 #define ASH_TEST_CHILD_MODAL_WINDOW_H_
8 #include "ui/views/controls/button/button.h"
9 #include "ui/views/widget/widget_delegate.h"
10 #include "ui/views/widget/widget_observer.h"
12 namespace views {
13 class LabelButton;
14 class NativeViewHost;
15 class Textfield;
16 class View;
17 class Widget;
20 namespace ash {
21 namespace test {
23 void CreateChildModalParent(gfx::NativeView context);
25 class ChildModalParent : public views::WidgetDelegateView,
26 public views::ButtonListener,
27 public views::WidgetObserver {
28 public:
29 ChildModalParent(gfx::NativeView context);
30 ~ChildModalParent() override;
32 void ShowChild();
33 gfx::NativeWindow GetModalParent() const;
34 gfx::NativeWindow GetChild() const;
36 private:
37 views::Widget* CreateChild();
39 // Overridden from views::WidgetDelegate:
40 View* GetContentsView() override;
41 base::string16 GetWindowTitle() const override;
42 bool CanResize() const override;
43 void DeleteDelegate() override;
45 // Overridden from views::View:
46 void Layout() override;
47 void ViewHierarchyChanged(
48 const ViewHierarchyChangedDetails& details) override;
50 // Overridden from ButtonListener:
51 void ButtonPressed(views::Button* sender, const ui::Event& event) override;
53 // Overridden from WidgetObserver:
54 void OnWidgetDestroying(views::Widget* widget) override;
56 // The button to toggle showing and hiding the child window. The child window
57 // does not block input to this button.
58 views::LabelButton* button_;
60 // The text field to indicate the keyboard focus.
61 views::Textfield* textfield_;
63 // The host for the modal parent.
64 views::NativeViewHost* host_;
66 // The modal parent of the child window. The child window blocks input to this
67 // view.
68 gfx::NativeWindow modal_parent_;
70 // The child window.
71 views::Widget* child_;
73 DISALLOW_COPY_AND_ASSIGN(ChildModalParent);
76 } // namespace test
77 } // namespace ash
79 #endif // ASH_TEST_CHILD_MODAL_WINDOW_H_