summaryrefslogtreecommitdiff
path: root/athena/test/sample_activity.cc
blob: 9f2da73e674f342df03fb29b18d0d69d1f9c6ba5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "athena/test/sample_activity.h"

#include "ui/views/background.h"
#include "ui/views/view.h"

namespace athena {
namespace test {

SampleActivity::SampleActivity(SkColor color,
                               SkColor contents_color,
                               const base::string16& title)
    : color_(color),
      contents_color_(contents_color),
      title_(title),
      contents_view_(NULL) {
}

SampleActivity::~SampleActivity() {
}

athena::ActivityViewModel* SampleActivity::GetActivityViewModel() {
  return this;
}

void SampleActivity::Init() {
}

SkColor SampleActivity::GetRepresentativeColor() {
  return color_;
}

base::string16 SampleActivity::GetTitle() {
  return title_;
}

views::View* SampleActivity::GetContentsView() {
  if (!contents_view_) {
    contents_view_ = new views::View;
    contents_view_->set_background(
        views::Background::CreateSolidBackground(contents_color_));
  }
  return contents_view_;
}

}  // namespace test
}  // namespace athena