usb_gadget: Switch to official Google product IDs.
[chromium-blink-merge.git] / ash / test / child_modal_window.h
blobed8553a9bf1b5db26ad6e0924462318a6975fcd2
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 virtual ~ChildModalParent();
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 virtual View* GetContentsView() OVERRIDE;
41 virtual base::string16 GetWindowTitle() const OVERRIDE;
42 virtual bool CanResize() const OVERRIDE;
43 virtual void DeleteDelegate() OVERRIDE;
45 // Overridden from views::View:
46 virtual void Layout() OVERRIDE;
47 virtual void ViewHierarchyChanged(
48 const ViewHierarchyChangedDetails& details) OVERRIDE;
50 // Overridden from ButtonListener:
51 virtual void ButtonPressed(views::Button* sender,
52 const ui::Event& event) OVERRIDE;
54 // Overridden from WidgetObserver:
55 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE;
57 // The button to toggle showing and hiding the child window. The child window
58 // does not block input to this button.
59 views::LabelButton* button_;
61 // The text field to indicate the keyboard focus.
62 views::Textfield* textfield_;
64 // The host for the modal parent.
65 views::NativeViewHost* host_;
67 // The modal parent of the child window. The child window blocks input to this
68 // view.
69 gfx::NativeWindow modal_parent_;
71 // The child window.
72 views::Widget* child_;
74 DISALLOW_COPY_AND_ASSIGN(ChildModalParent);
77 } // namespace test
78 } // namespace ash
80 #endif // ASH_TEST_CHILD_MODAL_WINDOW_H_