OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "mojo/examples/window_manager/debug_panel.h" | 5 #include "mojo/examples/window_manager/debug_panel.h" |
6 | 6 |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "mojo/services/public/cpp/view_manager/node.h" | 9 #include "mojo/services/public/cpp/view_manager/node.h" |
10 #include "mojo/views/native_widget_view_manager.h" | 10 #include "mojo/views/native_widget_view_manager.h" |
11 #include "ui/gfx/text_constants.h" | 11 #include "ui/gfx/text_constants.h" |
12 #include "ui/views/background.h" | 12 #include "ui/views/background.h" |
13 #include "ui/views/controls/button/blue_button.h" | 13 #include "ui/views/controls/button/blue_button.h" |
14 #include "ui/views/controls/button/radio_button.h" | 14 #include "ui/views/controls/button/radio_button.h" |
15 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
16 | 16 |
17 namespace mojo { | 17 namespace mojo { |
18 namespace examples { | 18 namespace examples { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 const int kControlBorderInset = 5; | 22 const int kControlBorderInset = 5; |
23 const int kNavigationTargetGroupId = 1; | 23 const int kNavigationTargetGroupId = 1; |
24 | 24 |
25 } // namespace | 25 } // namespace |
26 | 26 |
27 DebugPanel::DebugPanel(Delegate* delegate, view_manager::Node* node) | 27 DebugPanel::DebugPanel(Delegate* delegate, Node* node) |
28 : delegate_(delegate), | 28 : delegate_(delegate), |
29 node_(node), | 29 node_(node), |
30 navigation_target_label_(new views::Label( | 30 navigation_target_label_(new views::Label( |
31 base::ASCIIToUTF16("Navigation target:"))), | 31 base::ASCIIToUTF16("Navigation target:"))), |
32 navigation_target_new_(new views::RadioButton( | 32 navigation_target_new_(new views::RadioButton( |
33 base::ASCIIToUTF16("New window"), kNavigationTargetGroupId)), | 33 base::ASCIIToUTF16("New window"), kNavigationTargetGroupId)), |
34 navigation_target_source_(new views::RadioButton( | 34 navigation_target_source_(new views::RadioButton( |
35 base::ASCIIToUTF16("Source window"), kNavigationTargetGroupId)), | 35 base::ASCIIToUTF16("Source window"), kNavigationTargetGroupId)), |
36 navigation_target_default_(new views::RadioButton( | 36 navigation_target_default_(new views::RadioButton( |
37 base::ASCIIToUTF16("Default"), kNavigationTargetGroupId)), | 37 base::ASCIIToUTF16("Default"), kNavigationTargetGroupId)), |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 void DebugPanel::Navigate(const std::string& url) { | 130 void DebugPanel::Navigate(const std::string& url) { |
131 navigation::NavigationDetailsPtr details( | 131 navigation::NavigationDetailsPtr details( |
132 navigation::NavigationDetails::New()); | 132 navigation::NavigationDetails::New()); |
133 details->url = url; | 133 details->url = url; |
134 delegate_->RequestNavigate( | 134 delegate_->RequestNavigate( |
135 node_->id(), navigation::TARGET_NEW_NODE, details.Pass()); | 135 node_->id(), navigation::TARGET_NEW_NODE, details.Pass()); |
136 } | 136 } |
137 | 137 |
138 } // namespace examples | 138 } // namespace examples |
139 } // namespace mojo | 139 } // namespace mojo |
OLD | NEW |