Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / task_management / providers / web_contents / printing_task.cc
blob808fc63e9553d16435dbd504de4d1173bde5a007
1 // Copyright 2015 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.
5 #include "chrome/browser/task_management/providers/web_contents/printing_task.h"
7 #include "chrome/grit/generated_resources.h"
8 #include "content/public/browser/web_contents.h"
9 #include "ui/base/l10n/l10n_util.h"
11 namespace task_management {
13 namespace {
15 inline base::string16 PrefixTitle(const base::string16& title) {
16 return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_PRINT_PREFIX, title);
19 } // namespace
21 PrintingTask::PrintingTask(content::WebContents* web_contents)
22 : RendererTask(
23 PrefixTitle(RendererTask::GetTitleFromWebContents(web_contents)),
24 RendererTask::GetFaviconFromWebContents(web_contents),
25 web_contents,
26 web_contents->GetRenderProcessHost()) {
29 PrintingTask::~PrintingTask() {
32 void PrintingTask::OnTitleChanged(content::NavigationEntry* entry) {
33 set_title(PrefixTitle(RendererTask::GetTitleFromWebContents(web_contents())));
36 void PrintingTask::OnFaviconChanged() {
37 const gfx::ImageSkia* icon =
38 RendererTask::GetFaviconFromWebContents(web_contents());
39 set_icon(icon ? *icon : gfx::ImageSkia());
42 } // namespace task_management