OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "athena/content/web_activity.h" | 5 #include "athena/content/web_activity.h" |
6 | 6 |
7 #include "athena/activity/public/activity_manager.h" | 7 #include "athena/activity/public/activity_manager.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
10 | 10 |
11 namespace athena { | 11 namespace athena { |
12 | 12 |
13 WebActivity::WebActivity(content::WebContents* contents) | 13 WebActivity::WebActivity(content::WebContents* contents) |
14 : content::WebContentsObserver(contents) { | 14 : content::WebContentsObserver(contents) { |
15 } | 15 } |
16 | 16 |
17 WebActivity::~WebActivity() { | 17 WebActivity::~WebActivity() { |
18 ActivityManager::Get()->RemoveActivity(this); | |
19 } | 18 } |
20 | 19 |
21 ActivityViewModel* WebActivity::GetActivityViewModel() { | 20 ActivityViewModel* WebActivity::GetActivityViewModel() { |
22 return this; | 21 return this; |
23 } | 22 } |
24 | 23 |
25 SkColor WebActivity::GetRepresentativeColor() { | 24 SkColor WebActivity::GetRepresentativeColor() { |
26 // TODO(sad): Compute the color from the favicon. | 25 // TODO(sad): Compute the color from the favicon. |
27 return SK_ColorGRAY; | 26 return SK_ColorGRAY; |
28 } | 27 } |
(...skipping 10 matching lines...) Expand all Loading... |
39 bool explicit_set) { | 38 bool explicit_set) { |
40 ActivityManager::Get()->UpdateActivity(this); | 39 ActivityManager::Get()->UpdateActivity(this); |
41 } | 40 } |
42 | 41 |
43 void WebActivity::DidUpdateFaviconURL( | 42 void WebActivity::DidUpdateFaviconURL( |
44 const std::vector<content::FaviconURL>& candidates) { | 43 const std::vector<content::FaviconURL>& candidates) { |
45 ActivityManager::Get()->UpdateActivity(this); | 44 ActivityManager::Get()->UpdateActivity(this); |
46 } | 45 } |
47 | 46 |
48 } // namespace athena | 47 } // namespace athena |
OLD | NEW |