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/base/sample_activity.h" | 5 #include "athena/test/base/sample_activity.h" |
6 | 6 |
7 #include "ui/gfx/image/image_skia.h" | 7 #include "ui/gfx/image/image_skia.h" |
8 #include "ui/views/background.h" | 8 #include "ui/views/background.h" |
9 #include "ui/views/view.h" | 9 #include "ui/views/view.h" |
10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
11 | 11 |
12 namespace athena { | 12 namespace athena { |
13 namespace test { | 13 namespace test { |
14 | 14 |
15 SampleActivity::SampleActivity(SkColor color, | 15 SampleActivity::SampleActivity(SkColor color, |
16 SkColor contents_color, | 16 SkColor contents_color, |
17 const base::string16& title) | 17 const base::string16& title) |
18 : color_(color), | 18 : color_(color), |
19 contents_color_(contents_color), | 19 contents_color_(contents_color), |
20 title_(title), | 20 title_(title), |
21 contents_view_(NULL), | 21 contents_view_(nullptr), |
22 current_state_(ACTIVITY_UNLOADED) { | 22 current_state_(ACTIVITY_UNLOADED) { |
23 } | 23 } |
24 | 24 |
25 SampleActivity::~SampleActivity() { | 25 SampleActivity::~SampleActivity() { |
26 } | 26 } |
27 | 27 |
28 athena::ActivityViewModel* SampleActivity::GetActivityViewModel() { | 28 athena::ActivityViewModel* SampleActivity::GetActivityViewModel() { |
29 return this; | 29 return this; |
30 } | 30 } |
31 | 31 |
32 void SampleActivity::SetCurrentState(Activity::ActivityState state) { | 32 void SampleActivity::SetCurrentState(Activity::ActivityState state) { |
33 current_state_ = state; | 33 current_state_ = state; |
34 } | 34 } |
35 | 35 |
36 Activity::ActivityState SampleActivity::GetCurrentState() { | 36 Activity::ActivityState SampleActivity::GetCurrentState() { |
37 return current_state_; | 37 return current_state_; |
38 } | 38 } |
39 | 39 |
40 bool SampleActivity::IsVisible() { | 40 bool SampleActivity::IsVisible() { |
41 return contents_view_ && contents_view_->IsDrawn(); | 41 return contents_view_ && contents_view_->IsDrawn(); |
42 } | 42 } |
43 | 43 |
44 Activity::ActivityMediaState SampleActivity::GetMediaState() { | 44 Activity::ActivityMediaState SampleActivity::GetMediaState() { |
45 return Activity::ACTIVITY_MEDIA_STATE_NONE; | 45 return Activity::ACTIVITY_MEDIA_STATE_NONE; |
46 } | 46 } |
47 | 47 |
48 aura::Window* SampleActivity::GetWindow() { | 48 aura::Window* SampleActivity::GetWindow() { |
49 return !contents_view_ ? NULL | 49 return !contents_view_ ? nullptr |
50 : contents_view_->GetWidget()->GetNativeWindow(); | 50 : contents_view_->GetWidget()->GetNativeWindow(); |
51 } | 51 } |
52 | 52 |
53 content::WebContents* SampleActivity::GetWebContents() { | 53 content::WebContents* SampleActivity::GetWebContents() { |
54 return NULL; | 54 return nullptr; |
55 } | 55 } |
56 | 56 |
57 void SampleActivity::Init() { | 57 void SampleActivity::Init() { |
58 } | 58 } |
59 | 59 |
60 SkColor SampleActivity::GetRepresentativeColor() const { | 60 SkColor SampleActivity::GetRepresentativeColor() const { |
61 return color_; | 61 return color_; |
62 } | 62 } |
63 | 63 |
64 base::string16 SampleActivity::GetTitle() const { | 64 base::string16 SampleActivity::GetTitle() const { |
(...skipping 11 matching lines...) Expand all Loading... |
76 views::View* SampleActivity::GetContentsView() { | 76 views::View* SampleActivity::GetContentsView() { |
77 if (!contents_view_) { | 77 if (!contents_view_) { |
78 contents_view_ = new views::View; | 78 contents_view_ = new views::View; |
79 contents_view_->set_background( | 79 contents_view_->set_background( |
80 views::Background::CreateSolidBackground(contents_color_)); | 80 views::Background::CreateSolidBackground(contents_color_)); |
81 } | 81 } |
82 return contents_view_; | 82 return contents_view_; |
83 } | 83 } |
84 | 84 |
85 views::Widget* SampleActivity::CreateWidget() { | 85 views::Widget* SampleActivity::CreateWidget() { |
86 return NULL; | 86 return nullptr; |
87 } | 87 } |
88 | 88 |
89 gfx::ImageSkia SampleActivity::GetOverviewModeImage() { | 89 gfx::ImageSkia SampleActivity::GetOverviewModeImage() { |
90 return gfx::ImageSkia(); | 90 return gfx::ImageSkia(); |
91 } | 91 } |
92 | 92 |
93 void SampleActivity::PrepareContentsForOverview() { | 93 void SampleActivity::PrepareContentsForOverview() { |
94 } | 94 } |
95 | 95 |
96 void SampleActivity::ResetContentsView() { | 96 void SampleActivity::ResetContentsView() { |
97 } | 97 } |
98 | 98 |
99 } // namespace test | 99 } // namespace test |
100 } // namespace athena | 100 } // namespace athena |
OLD | NEW |