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