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

Unified Diff: athena/main/sample_activity.cc

Issue 302683002: athena: Add the concept of Activity and related managers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « athena/main/sample_activity.h ('k') | athena/main/web_activity.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/main/sample_activity.cc
diff --git a/athena/main/sample_activity.cc b/athena/main/sample_activity.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8ad23e7679d9b5d64f327dd67cde290fbfd38f80
--- /dev/null
+++ b/athena/main/sample_activity.cc
@@ -0,0 +1,37 @@
+// 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/main/sample_activity.h"
+
+#include "ui/aura/window.h"
+
+SampleActivity::SampleActivity(SkColor color,
+ SkColor content_color,
+ const std::string& title)
+ : color_(color), content_color_(content_color), title_(title) {
+}
+
+SampleActivity::~SampleActivity() {
+}
+
+athena::ActivityViewModel* SampleActivity::GetActivityViewModel() {
+ return this;
+}
+
+SkColor SampleActivity::GetRepresentativeColor() {
+ return color_;
+}
+
+std::string SampleActivity::GetTitle() {
+ return title_;
+}
+
+aura::Window* SampleActivity::GetNativeWindow() {
+ if (!window_) {
+ window_.reset(new aura::Window(NULL));
+ window_->Init(aura::WINDOW_LAYER_SOLID_COLOR);
+ window_->layer()->SetColor(content_color_);
+ }
+ return window_.get();
+}
« no previous file with comments | « athena/main/sample_activity.h ('k') | athena/main/web_activity.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698