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 "athena/test/sample_activity.h" | 5 #include "athena/test/sample_activity.h" |
6 | 6 |
7 #include "ui/aura/window.h" | 7 #include "ui/views/background.h" |
| 8 #include "ui/views/view.h" |
8 | 9 |
9 namespace athena { | 10 namespace athena { |
10 namespace test { | 11 namespace test { |
11 | 12 |
12 SampleActivity::SampleActivity(SkColor color, | 13 SampleActivity::SampleActivity(SkColor color, |
13 SkColor content_color, | 14 SkColor contents_color, |
14 const std::string& title) | 15 const std::string& title) |
15 : color_(color), content_color_(content_color), title_(title) { | 16 : color_(color), |
| 17 contents_color_(contents_color), |
| 18 title_(title), |
| 19 contents_view_(NULL) { |
16 } | 20 } |
17 | 21 |
18 SampleActivity::~SampleActivity() { | 22 SampleActivity::~SampleActivity() { |
19 } | 23 } |
20 | 24 |
21 athena::ActivityViewModel* SampleActivity::GetActivityViewModel() { | 25 athena::ActivityViewModel* SampleActivity::GetActivityViewModel() { |
22 return this; | 26 return this; |
23 } | 27 } |
24 | 28 |
25 SkColor SampleActivity::GetRepresentativeColor() { | 29 SkColor SampleActivity::GetRepresentativeColor() { |
26 return color_; | 30 return color_; |
27 } | 31 } |
28 | 32 |
29 std::string SampleActivity::GetTitle() { | 33 std::string SampleActivity::GetTitle() { |
30 return title_; | 34 return title_; |
31 } | 35 } |
32 | 36 |
33 aura::Window* SampleActivity::GetNativeWindow() { | 37 views::View* SampleActivity::GetContentsView() { |
34 if (!window_) { | 38 if (!contents_view_) { |
35 window_.reset(new aura::Window(NULL)); | 39 contents_view_ = new views::View; |
36 window_->Init(aura::WINDOW_LAYER_SOLID_COLOR); | 40 contents_view_->set_background( |
37 window_->layer()->SetColor(content_color_); | 41 views::Background::CreateSolidBackground(contents_color_)); |
38 } | 42 } |
39 return window_.get(); | 43 return contents_view_; |
40 } | 44 } |
41 | 45 |
42 } // namespace test | 46 } // namespace test |
43 } // namespace athena | 47 } // namespace athena |
OLD | NEW |