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

Side by Side Diff: athena/main/web_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, 6 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
« no previous file with comments | « athena/main/web_activity.h ('k') | no next file » | 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/main/web_activity.h"
6
7 #include "athena/activity/public/activity_manager.h"
8 #include "base/strings/utf_string_conversions.h"
9 #include "content/public/browser/web_contents.h"
10
11 WebActivity::WebActivity(content::WebContents* contents)
12 : content::WebContentsObserver(contents) {
13 }
14
15 WebActivity::~WebActivity() {
16 athena::ActivityManager::Get()->RemoveActivity(this);
17 }
18
19 athena::ActivityViewModel* WebActivity::GetActivityViewModel() {
20 return this;
21 }
22
23 SkColor WebActivity::GetRepresentativeColor() {
24 // TODO(sad): Compute the color from the favicon.
25 return SK_ColorGRAY;
26 }
27
28 std::string WebActivity::GetTitle() {
29 return base::UTF16ToUTF8(web_contents()->GetTitle());
30 }
31
32 aura::Window* WebActivity::GetNativeWindow() {
33 return web_contents()->GetNativeView();
34 }
35
36 void WebActivity::TitleWasSet(content::NavigationEntry* entry,
37 bool explicit_set) {
38 athena::ActivityManager::Get()->UpdateActivity(this);
39 }
40
41 void WebActivity::DidUpdateFaviconURL(
42 const std::vector<content::FaviconURL>& candidates) {
43 athena::ActivityManager::Get()->UpdateActivity(this);
44 }
OLDNEW
« no previous file with comments | « athena/main/web_activity.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698