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
3 // found in the LICENSE file.
5 #include "athena/test/sample_activity.h"
7 #include "ui/views/background.h"
8 #include "ui/views/view.h"
13 SampleActivity::SampleActivity(SkColor color
,
14 SkColor contents_color
,
15 const base::string16
& title
)
17 contents_color_(contents_color
),
20 current_state_(ACTIVITY_UNLOADED
) {
23 SampleActivity::~SampleActivity() {
26 athena::ActivityViewModel
* SampleActivity::GetActivityViewModel() {
30 void SampleActivity::SetCurrentState(Activity::ActivityState state
) {
31 current_state_
= state
;
34 Activity::ActivityState
SampleActivity::GetCurrentState() {
35 return current_state_
;
38 bool SampleActivity::IsVisible() {
39 return contents_view_
&& contents_view_
->IsDrawn();
42 Activity::ActivityMediaState
SampleActivity::GetMediaState() {
43 return Activity::ACTIVITY_MEDIA_STATE_NONE
;
46 void SampleActivity::Init() {
49 SkColor
SampleActivity::GetRepresentativeColor() const {
53 base::string16
SampleActivity::GetTitle() const {
57 bool SampleActivity::UsesFrame() const {
61 views::View
* SampleActivity::GetContentsView() {
62 if (!contents_view_
) {
63 contents_view_
= new views::View
;
64 contents_view_
->set_background(
65 views::Background::CreateSolidBackground(contents_color_
));
67 return contents_view_
;
70 void SampleActivity::CreateOverviewModeImage() {
73 gfx::ImageSkia
SampleActivity::GetOverviewModeImage() {
74 return gfx::ImageSkia();