OLD | NEW |
(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 } |
OLD | NEW |