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

Side by Side Diff: chrome/browser/chromeos/login/ui/web_contents_forced_title.cc

Issue 2550263002: cros: Ensure task manager shows correct title for lock screen webview (Closed)
Patch Set: Rebase Created 4 years 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
OLDNEW
(Empty)
1 // Copyright 2016 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 "chrome/browser/chromeos/login/ui/web_contents_forced_title.h"
6
7 #include "content/public/browser/navigation_entry.h"
8 #include "content/public/browser/web_contents.h"
9
10 DEFINE_WEB_CONTENTS_USER_DATA_KEY(chromeos::WebContentsForcedTitle);
11
12 namespace chromeos {
13
14 // static
15 void WebContentsForcedTitle::CreateForWebContentsWithTitle(
16 content::WebContents* web_contents,
17 const base::string16& title) {
18 if (FromWebContents(web_contents))
19 return;
20
21 web_contents->UpdateTitleForEntry(nullptr, title);
22 web_contents->SetUserData(UserDataKey(),
23 new WebContentsForcedTitle(web_contents, title));
24 }
25
26 WebContentsForcedTitle::WebContentsForcedTitle(
27 content::WebContents* web_contents,
28 const base::string16& title)
29 : content::WebContentsObserver(web_contents), title_(title) {}
30
31 WebContentsForcedTitle::~WebContentsForcedTitle() {}
32
33 void WebContentsForcedTitle::TitleWasSet(content::NavigationEntry* entry,
34 bool explicit_set) {
35 if (!entry || entry->GetTitle() != title_)
36 web_contents()->UpdateTitleForEntry(entry, title_);
37 }
38
39 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/ui/web_contents_forced_title.h ('k') | chrome/browser/chromeos/login/ui/webui_login_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698