OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "views/examples/native_widget_views_example.h" | 5 #include "views/examples/native_widget_views_example.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "ui/gfx/canvas.h" | 8 #include "ui/gfx/canvas.h" |
9 #include "views/controls/button/text_button.h" | 9 #include "views/controls/button/text_button.h" |
10 #include "views/examples/example_base.h" | 10 #include "views/examples/example_base.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 } | 49 } |
50 | 50 |
51 private: | 51 private: |
52 int click_count_; | 52 int click_count_; |
53 views::TextButton* button_; | 53 views::TextButton* button_; |
54 | 54 |
55 DISALLOW_COPY_AND_ASSIGN(TestContentView); | 55 DISALLOW_COPY_AND_ASSIGN(TestContentView); |
56 }; | 56 }; |
57 | 57 |
58 NativeWidgetViewsExample::NativeWidgetViewsExample(ExamplesMain* main) | 58 NativeWidgetViewsExample::NativeWidgetViewsExample(ExamplesMain* main) |
59 : ExampleBase(main, "NativeWidgetViews") { | 59 : ExampleBase(main, "Native Widget Views") { |
60 } | 60 } |
61 | 61 |
62 NativeWidgetViewsExample::~NativeWidgetViewsExample() { | 62 NativeWidgetViewsExample::~NativeWidgetViewsExample() { |
63 } | 63 } |
64 | 64 |
65 void NativeWidgetViewsExample::CreateExampleView(views::View* container) { | 65 void NativeWidgetViewsExample::CreateExampleView(views::View* container) { |
66 views::Widget* widget = new views::Widget; | 66 views::Widget* widget = new views::Widget; |
67 views::NativeWidgetViews* nwv = new views::NativeWidgetViews(widget); | 67 views::NativeWidgetViews* nwv = new views::NativeWidgetViews(widget); |
68 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); | 68 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); |
69 | 69 |
(...skipping 16 matching lines...) Expand all Loading... |
86 | 86 |
87 #if defined(OS_WIN) | 87 #if defined(OS_WIN) |
88 test_views_delegate->set_default_parent_view(old_default_parent_view); | 88 test_views_delegate->set_default_parent_view(old_default_parent_view); |
89 #endif | 89 #endif |
90 | 90 |
91 widget->SetContentsView(new TestContentView); | 91 widget->SetContentsView(new TestContentView); |
92 widget->SetBounds(gfx::Rect(10, 10, 300, 150)); | 92 widget->SetBounds(gfx::Rect(10, 10, 300, 150)); |
93 } | 93 } |
94 | 94 |
95 } // namespace examples | 95 } // namespace examples |
OLD | NEW |