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

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

Issue 863033002: Delete athena/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « athena/test/base/sample_activity.h ('k') | athena/test/base/sample_activity_factory.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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/base/sample_activity.h"
6
7 #include "athena/input/public/accelerator_manager.h"
8 #include "ui/gfx/image/image_skia.h"
9 #include "ui/views/background.h"
10 #include "ui/views/view.h"
11 #include "ui/views/widget/widget.h"
12
13 namespace athena {
14 namespace test {
15
16 SampleActivity::SampleActivity(SkColor color,
17 SkColor contents_color,
18 const base::string16& title)
19 : color_(color),
20 contents_color_(contents_color),
21 title_(title),
22 contents_view_(nullptr),
23 current_state_(ACTIVITY_UNLOADED) {
24 }
25
26 SampleActivity::~SampleActivity() {
27 }
28
29 athena::ActivityViewModel* SampleActivity::GetActivityViewModel() {
30 return this;
31 }
32
33 void SampleActivity::SetCurrentState(Activity::ActivityState state) {
34 current_state_ = state;
35 }
36
37 Activity::ActivityState SampleActivity::GetCurrentState() {
38 return current_state_;
39 }
40
41 bool SampleActivity::IsVisible() {
42 return contents_view_ && contents_view_->IsDrawn();
43 }
44
45 Activity::ActivityMediaState SampleActivity::GetMediaState() {
46 return Activity::ACTIVITY_MEDIA_STATE_NONE;
47 }
48
49 aura::Window* SampleActivity::GetWindow() {
50 return !contents_view_ ? nullptr
51 : contents_view_->GetWidget()->GetNativeWindow();
52 }
53
54 content::WebContents* SampleActivity::GetWebContents() {
55 return nullptr;
56 }
57
58 void SampleActivity::Init() {
59 accelerator_manager_ = AcceleratorManager::CreateForFocusManager(
60 GetContentsView()->GetWidget()->GetFocusManager());
61 }
62
63 SkColor SampleActivity::GetRepresentativeColor() const {
64 return color_;
65 }
66
67 base::string16 SampleActivity::GetTitle() const {
68 return title_;
69 }
70
71 gfx::ImageSkia SampleActivity::GetIcon() const {
72 return gfx::ImageSkia();
73 }
74
75 void SampleActivity::SetActivityView(ActivityView* view) {
76 }
77
78 bool SampleActivity::UsesFrame() const {
79 return true;
80 }
81
82 views::View* SampleActivity::GetContentsView() {
83 if (!contents_view_) {
84 contents_view_ = new views::View;
85 contents_view_->set_background(
86 views::Background::CreateSolidBackground(contents_color_));
87 }
88 return contents_view_;
89 }
90
91 gfx::ImageSkia SampleActivity::GetOverviewModeImage() {
92 return gfx::ImageSkia();
93 }
94
95 void SampleActivity::PrepareContentsForOverview() {
96 }
97
98 void SampleActivity::ResetContentsView() {
99 }
100
101 } // namespace test
102 } // namespace athena
OLDNEW
« no previous file with comments | « athena/test/base/sample_activity.h ('k') | athena/test/base/sample_activity_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698