OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/examples/widget_example.h" | 5 #include "ui/views/examples/widget_example.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "ui/views/background.h" | 10 #include "ui/views/background.h" |
11 #include "ui/views/controls/button/label_button.h" | 11 #include "ui/views/controls/button/md_text_button.h" |
12 #include "ui/views/controls/label.h" | 12 #include "ui/views/controls/label.h" |
13 #include "ui/views/layout/box_layout.h" | 13 #include "ui/views/layout/box_layout.h" |
14 #include "ui/views/view.h" | 14 #include "ui/views/view.h" |
15 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
16 #include "ui/views/window/dialog_delegate.h" | 16 #include "ui/views/window/dialog_delegate.h" |
17 | 17 |
18 using base::ASCIIToUTF16; | 18 using base::ASCIIToUTF16; |
19 | 19 |
20 namespace views { | 20 namespace views { |
21 namespace examples { | 21 namespace examples { |
(...skipping 26 matching lines...) Expand all Loading... |
48 AddChildView(new Label(ASCIIToUTF16("Dialog contents label!"))); | 48 AddChildView(new Label(ASCIIToUTF16("Dialog contents label!"))); |
49 } | 49 } |
50 | 50 |
51 DialogExample::~DialogExample() {} | 51 DialogExample::~DialogExample() {} |
52 | 52 |
53 base::string16 DialogExample::GetWindowTitle() const { | 53 base::string16 DialogExample::GetWindowTitle() const { |
54 return ASCIIToUTF16("Dialog Widget Example"); | 54 return ASCIIToUTF16("Dialog Widget Example"); |
55 } | 55 } |
56 | 56 |
57 View* DialogExample::CreateExtraView() { | 57 View* DialogExample::CreateExtraView() { |
58 LabelButton* button = new LabelButton(NULL, ASCIIToUTF16("Extra button!")); | 58 return MdTextButton::CreateSecondaryUiButton(nullptr, |
59 button->SetStyle(Button::STYLE_BUTTON); | 59 ASCIIToUTF16("Extra button!")); |
60 return button; | |
61 } | 60 } |
62 | 61 |
63 View* DialogExample::CreateFootnoteView() { | 62 View* DialogExample::CreateFootnoteView() { |
64 return new Label(ASCIIToUTF16("Footnote label!")); | 63 return new Label(ASCIIToUTF16("Footnote label!")); |
65 } | 64 } |
66 | 65 |
67 } // namespace | 66 } // namespace |
68 | 67 |
69 WidgetExample::WidgetExample() : ExampleBase("Widget") { | 68 WidgetExample::WidgetExample() : ExampleBase("Widget") { |
70 } | 69 } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 ShowWidget(sender, Widget::InitParams(Widget::InitParams::TYPE_CONTROL)); | 132 ShowWidget(sender, Widget::InitParams(Widget::InitParams::TYPE_CONTROL)); |
134 break; | 133 break; |
135 case CLOSE_WIDGET: | 134 case CLOSE_WIDGET: |
136 sender->GetWidget()->Close(); | 135 sender->GetWidget()->Close(); |
137 break; | 136 break; |
138 } | 137 } |
139 } | 138 } |
140 | 139 |
141 } // namespace examples | 140 } // namespace examples |
142 } // namespace views | 141 } // namespace views |
OLD | NEW |