Introduce new SPDY Version UMA histogram.
[chromium-blink-merge.git] / mojo / examples / window_manager / debug_panel.h
blob3a771aab8cc8b91f4df16bb01d6e9cbe98da0103
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 MOJO_EXAMPLES_WINDOW_MANAGER_DEBUG_PANEL_H_
6 #define MOJO_EXAMPLES_WINDOW_MANAGER_DEBUG_PANEL_H_
8 #include <string>
10 #include "mojo/services/public/interfaces/navigation/navigation.mojom.h"
11 #include "ui/views/controls/button/button.h"
12 #include "ui/views/layout/layout_manager.h"
13 #include "ui/views/widget/widget_delegate.h"
15 namespace views {
16 class Label;
17 class RadioButton;
20 namespace mojo {
22 class View;
24 namespace examples {
26 namespace {
29 // A panel of controls intended to demonstrate the functionality of the window
30 // manager.
31 class DebugPanel : public views::LayoutManager, public views::ButtonListener {
32 public:
33 class Delegate {
34 public:
35 virtual void CloseTopWindow() = 0;
36 virtual void RequestNavigate(uint32 source_view_id,
37 Target target,
38 URLRequestPtr url_request) = 0;
40 protected:
41 virtual ~Delegate(){}
44 DebugPanel(Delegate* delegate, View* view);
45 virtual ~DebugPanel();
47 Target navigation_target() const;
49 private:
50 // LayoutManager overrides:
51 virtual gfx::Size GetPreferredSize(const views::View* view) const OVERRIDE;
52 virtual void Layout(views::View* host) OVERRIDE;
53 virtual void ButtonPressed(views::Button* sender,
54 const ui::Event& event) OVERRIDE;
56 void Navigate(const std::string& url);
58 Delegate* delegate_;
59 View* view_;
61 views::Label* navigation_target_label_;
62 views::RadioButton* navigation_target_new_;
63 views::RadioButton* navigation_target_source_;
64 views::RadioButton* navigation_target_default_;
66 views::Button* colored_square_;
67 views::Button* close_last_;
68 views::Button* cross_app_;
70 DISALLOW_COPY_AND_ASSIGN(DebugPanel);
73 } // examples
74 } // mojo
76 #endif // MOJO_EXAMPLES_WINDOW_MANAGER_DEBUG_PANEL_H_