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

Unified Diff: athena/main/web_task.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
Index: athena/main/web_task.cc
diff --git a/athena/main/web_task.cc b/athena/main/web_task.cc
new file mode 100644
index 0000000000000000000000000000000000000000..eb8567fdfb756a2cff507622629b9c6644077ee5
--- /dev/null
+++ b/athena/main/web_task.cc
@@ -0,0 +1,40 @@
+// 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/web_task.h"
+
+#include "athena/task/public/task_manager.h"
+#include "base/strings/utf_string_conversions.h"
+#include "content/public/browser/web_contents.h"
+
+WebTask::WebTask(content::WebContents* contents)
+ : content::WebContentsObserver(contents) {
+}
+
+WebTask::~WebTask() {
+ athena::TaskManager::Get()->RemoveTask(this);
+}
+
+SkColor WebTask::GetRepresentativeColor() {
+ // TODO(sad): Compute the color from the favicon.
+ return SK_ColorGRAY;
+}
+
+std::string WebTask::GetTitle() {
+ return base::UTF16ToUTF8(web_contents()->GetTitle());
+}
+
+aura::Window* WebTask::GetNativeWindow() {
+ return web_contents()->GetNativeView();
+}
+
+void WebTask::TitleWasSet(content::NavigationEntry* entry,
+ bool explicit_set) {
+ athena::TaskManager::Get()->UpdateTask(this);
+}
+
+void WebTask::DidUpdateFaviconURL(
+ const std::vector<content::FaviconURL>& candidates) {
+ athena::TaskManager::Get()->UpdateTask(this);
+}
« no previous file with comments | « athena/main/web_task.h ('k') | athena/task/DEPS » ('j') | athena/task/public/task.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698