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