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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "ui/views/background.h" | 8 #include "ui/views/background.h" |
9 #include "ui/views/controls/button/label_button.h" | 9 #include "ui/views/controls/button/label_button.h" |
10 #include "ui/views/controls/label.h" | 10 #include "ui/views/controls/label.h" |
11 #include "ui/views/layout/box_layout.h" | 11 #include "ui/views/layout/box_layout.h" |
12 #include "ui/views/view.h" | 12 #include "ui/views/view.h" |
13 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
14 #include "ui/views/window/dialog_delegate.h" | 14 #include "ui/views/window/dialog_delegate.h" |
15 | 15 |
16 using base::ASCIIToUTF16; | 16 using base::ASCIIToUTF16; |
17 | 17 |
18 namespace views { | 18 namespace views { |
19 namespace examples { | 19 namespace examples { |
20 | 20 |
21 namespace { | 21 namespace { |
22 | 22 |
23 class DialogExample : public DialogDelegateView { | 23 class DialogExample : public DialogDelegateView { |
24 public: | 24 public: |
25 DialogExample(); | 25 DialogExample(); |
26 virtual ~DialogExample(); | 26 virtual ~DialogExample(); |
27 virtual base::string16 GetWindowTitle() const OVERRIDE; | 27 virtual base::string16 GetWindowTitle() const override; |
28 virtual View* CreateExtraView() OVERRIDE; | 28 virtual View* CreateExtraView() override; |
29 virtual View* CreateTitlebarExtraView() OVERRIDE; | 29 virtual View* CreateTitlebarExtraView() override; |
30 virtual View* CreateFootnoteView() OVERRIDE; | 30 virtual View* CreateFootnoteView() override; |
31 }; | 31 }; |
32 | 32 |
33 DialogExample::DialogExample() { | 33 DialogExample::DialogExample() { |
34 set_background(Background::CreateSolidBackground(SK_ColorGRAY)); | 34 set_background(Background::CreateSolidBackground(SK_ColorGRAY)); |
35 SetLayoutManager(new BoxLayout(BoxLayout::kVertical, 10, 10, 10)); | 35 SetLayoutManager(new BoxLayout(BoxLayout::kVertical, 10, 10, 10)); |
36 AddChildView(new Label(ASCIIToUTF16("Dialog contents label!"))); | 36 AddChildView(new Label(ASCIIToUTF16("Dialog contents label!"))); |
37 } | 37 } |
38 | 38 |
39 DialogExample::~DialogExample() {} | 39 DialogExample::~DialogExample() {} |
40 | 40 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 ShowWidget(sender, Widget::InitParams(Widget::InitParams::TYPE_CONTROL)); | 120 ShowWidget(sender, Widget::InitParams(Widget::InitParams::TYPE_CONTROL)); |
121 break; | 121 break; |
122 case CLOSE_WIDGET: | 122 case CLOSE_WIDGET: |
123 sender->GetWidget()->Close(); | 123 sender->GetWidget()->Close(); |
124 break; | 124 break; |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 } // namespace examples | 128 } // namespace examples |
129 } // namespace views | 129 } // namespace views |
OLD | NEW |