OLD | NEW |
| (Empty) |
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 MOJO_EXAMPLES_WINDOW_MANAGER_DEBUG_PANEL_H_ | |
6 #define MOJO_EXAMPLES_WINDOW_MANAGER_DEBUG_PANEL_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/macros.h" | |
11 #include "mojo/services/public/interfaces/navigation/navigation.mojom.h" | |
12 #include "ui/views/controls/button/button.h" | |
13 #include "ui/views/layout/layout_manager.h" | |
14 #include "ui/views/widget/widget_delegate.h" | |
15 | |
16 namespace views { | |
17 class Label; | |
18 class RadioButton; | |
19 } | |
20 | |
21 namespace mojo { | |
22 | |
23 class Shell; | |
24 class View; | |
25 | |
26 namespace examples { | |
27 | |
28 // A panel of controls intended to demonstrate the functionality of the window | |
29 // manager. | |
30 class DebugPanel : public views::LayoutManager, public views::ButtonListener { | |
31 public: | |
32 class Delegate { | |
33 public: | |
34 virtual void CloseTopWindow() = 0; | |
35 virtual void RequestNavigate(uint32 source_view_id, | |
36 Target target, | |
37 URLRequestPtr url_request) = 0; | |
38 | |
39 protected: | |
40 virtual ~Delegate(){} | |
41 }; | |
42 | |
43 DebugPanel(Delegate* delegate, Shell* shell, View* view); | |
44 virtual ~DebugPanel(); | |
45 | |
46 Target navigation_target() const; | |
47 | |
48 private: | |
49 // LayoutManager overrides: | |
50 virtual gfx::Size GetPreferredSize(const views::View* view) const override; | |
51 virtual void Layout(views::View* host) override; | |
52 virtual void ButtonPressed(views::Button* sender, | |
53 const ui::Event& event) override; | |
54 | |
55 void Navigate(const std::string& url); | |
56 | |
57 Delegate* delegate_; | |
58 Shell* shell_; | |
59 View* view_; | |
60 | |
61 views::Label* navigation_target_label_; | |
62 views::RadioButton* navigation_target_new_; | |
63 views::RadioButton* navigation_target_source_; | |
64 views::RadioButton* navigation_target_default_; | |
65 | |
66 views::Button* colored_square_; | |
67 views::Button* close_last_; | |
68 views::Button* cross_app_; | |
69 | |
70 DISALLOW_COPY_AND_ASSIGN(DebugPanel); | |
71 }; | |
72 | |
73 } // examples | |
74 } // mojo | |
75 | |
76 #endif // MOJO_EXAMPLES_WINDOW_MANAGER_DEBUG_PANEL_H_ | |
OLD | NEW |