Enable lock even when no password hash is present.
[chromium-blink-merge.git] / mojo / examples / window_manager / debug_panel.h
blob90e4da86dacca4e7224ae6aee801b49631dd5c5e
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(
37 uint32 source_view_id, Target target,
38 NavigationDetailsPtr nav_details) = 0;
39 protected:
40 virtual ~Delegate(){}
43 DebugPanel(Delegate* delegate, View* view);
44 virtual ~DebugPanel();
46 Target navigation_target() const;
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;
55 void Navigate(const std::string& url);
57 Delegate* delegate_;
58 View* view_;
60 views::Label* navigation_target_label_;
61 views::RadioButton* navigation_target_new_;
62 views::RadioButton* navigation_target_source_;
63 views::RadioButton* navigation_target_default_;
65 views::Button* colored_square_;
66 views::Button* close_last_;
67 views::Button* cross_app_;
69 DISALLOW_COPY_AND_ASSIGN(DebugPanel);
72 } // examples
73 } // mojo
75 #endif // MOJO_EXAMPLES_WINDOW_MANAGER_DEBUG_PANEL_H_