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
{
15 inline base::string16
PrefixTitle(const base::string16
& title
) {
16 return l10n_util::GetStringFUTF16(IDS_TASK_MANAGER_PRINT_PREFIX
, title
);
21 PrintingTask::PrintingTask(content::WebContents
* web_contents
)
23 PrefixTitle(RendererTask::GetTitleFromWebContents(web_contents
)),
24 RendererTask::GetFaviconFromWebContents(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