Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Side by Side Diff: athena/test/sample_activity.cc

Issue 358003002: Additions to Activities to allow resource management (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « athena/test/sample_activity.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 base::string16& 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 current_state_(ACTIVITY_UNLOADED) {
20 } 21 }
21 22
22 SampleActivity::~SampleActivity() { 23 SampleActivity::~SampleActivity() {
23 } 24 }
24 25
25 athena::ActivityViewModel* SampleActivity::GetActivityViewModel() { 26 athena::ActivityViewModel* SampleActivity::GetActivityViewModel() {
26 return this; 27 return this;
27 } 28 }
28 29
30 void SampleActivity::SetCurrentState(Activity::ActivityState state) {
31 current_state_ = state;
32 }
33
34 Activity::ActivityState SampleActivity::GetCurrentState() {
35 return current_state_;
36 }
37
38 bool SampleActivity::IsVisible() {
39 return contents_view_ && contents_view_->IsDrawn();
40 }
41
42 Activity::ActivityMediaState SampleActivity::GetMediaState() {
43 return Activity::ACTIVITY_MEDIA_STATE_NONE;
44 }
45
29 void SampleActivity::Init() { 46 void SampleActivity::Init() {
30 } 47 }
31 48
32 SkColor SampleActivity::GetRepresentativeColor() const { 49 SkColor SampleActivity::GetRepresentativeColor() const {
33 return color_; 50 return color_;
34 } 51 }
35 52
36 base::string16 SampleActivity::GetTitle() const { 53 base::string16 SampleActivity::GetTitle() const {
37 return title_; 54 return title_;
38 } 55 }
39 56
40 bool SampleActivity::UsesFrame() const { 57 bool SampleActivity::UsesFrame() const {
41 return true; 58 return true;
42 } 59 }
43 60
44 views::View* SampleActivity::GetContentsView() { 61 views::View* SampleActivity::GetContentsView() {
45 if (!contents_view_) { 62 if (!contents_view_) {
46 contents_view_ = new views::View; 63 contents_view_ = new views::View;
47 contents_view_->set_background( 64 contents_view_->set_background(
48 views::Background::CreateSolidBackground(contents_color_)); 65 views::Background::CreateSolidBackground(contents_color_));
49 } 66 }
50 return contents_view_; 67 return contents_view_;
51 } 68 }
52 69
70 void SampleActivity::CreateOverviewModeImage() {
71 }
72
73 gfx::ImageSkia SampleActivity::GetOverviewModeImage() {
74 return gfx::ImageSkia();
75 }
76
53 } // namespace test 77 } // namespace test
54 } // namespace athena 78 } // namespace athena
OLDNEW
« no previous file with comments | « athena/test/sample_activity.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698