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