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 "ui/aura_shell/sample_window.h" | 5 #include "ui/aura_shell/sample_window.h" |
6 | 6 |
| 7 #include "ui/aura/window.h" |
7 #include "ui/gfx/canvas.h" | 8 #include "ui/gfx/canvas.h" |
8 #include "views/widget/widget.h" | 9 #include "views/widget/widget.h" |
9 | 10 |
10 namespace aura_shell { | 11 namespace aura_shell { |
11 namespace internal { | 12 namespace internal { |
12 | 13 |
13 // static | 14 // static |
14 void SampleWindow::CreateSampleWindow() { | 15 void SampleWindow::CreateSampleWindow() { |
15 views::Widget::CreateWindowWithBounds(new SampleWindow, | 16 views::Widget* widget = |
16 gfx::Rect(120, 150, 400, 300))->Show(); | 17 views::Widget::CreateWindowWithBounds(new SampleWindow, |
| 18 gfx::Rect(120, 150, 400, 300)); |
| 19 widget->GetNativeView()->set_name(L"SampleWindow"); |
| 20 widget->Show(); |
17 } | 21 } |
18 | 22 |
19 SampleWindow::SampleWindow() { | 23 SampleWindow::SampleWindow() { |
20 } | 24 } |
21 | 25 |
22 SampleWindow::~SampleWindow() { | 26 SampleWindow::~SampleWindow() { |
23 } | 27 } |
24 | 28 |
25 void SampleWindow::OnPaint(gfx::Canvas* canvas) { | 29 void SampleWindow::OnPaint(gfx::Canvas* canvas) { |
26 canvas->FillRectInt(SK_ColorDKGRAY, 0, 0, width(), height()); | 30 canvas->FillRectInt(SK_ColorDKGRAY, 0, 0, width(), height()); |
27 } | 31 } |
28 | 32 |
29 std::wstring SampleWindow::GetWindowTitle() const { | 33 std::wstring SampleWindow::GetWindowTitle() const { |
30 return L"Sample Window"; | 34 return L"Sample Window"; |
31 } | 35 } |
32 | 36 |
33 views::View* SampleWindow::GetContentsView() { | 37 views::View* SampleWindow::GetContentsView() { |
34 return this; | 38 return this; |
35 } | 39 } |
36 | 40 |
37 } // namespace internal | 41 } // namespace internal |
38 } // namespace aura_shell | 42 } // namespace aura_shell |
OLD | NEW |