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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
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/main/web_task.h"
6
7 #include "athena/task/public/task_manager.h"
8 #include "base/strings/utf_string_conversions.h"
9 #include "content/public/browser/web_contents.h"
10
11 WebTask::WebTask(content::WebContents* contents)
12 : content::WebContentsObserver(contents) {
13 }
14
15 WebTask::~WebTask() {
16 athena::TaskManager::Get()->RemoveTask(this);
17 }
18
19 SkColor WebTask::GetRepresentativeColor() {
20 // TODO(sad): Compute the color from the favicon.
21 return SK_ColorGRAY;
22 }
23
24 std::string WebTask::GetTitle() {
25 return base::UTF16ToUTF8(web_contents()->GetTitle());
26 }
27
28 aura::Window* WebTask::GetNativeWindow() {
29 return web_contents()->GetNativeView();
30 }
31
32 void WebTask::TitleWasSet(content::NavigationEntry* entry,
33 bool explicit_set) {
34 athena::TaskManager::Get()->UpdateTask(this);
35 }
36
37 void WebTask::DidUpdateFaviconURL(
38 const std::vector<content::FaviconURL>& candidates) {
39 athena::TaskManager::Get()->UpdateTask(this);
40 }
OLDNEW
« 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