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

Unified Diff: chrome/browser/chromeos/login/ui/web_contents_forced_title.h

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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/login/ui/web_contents_forced_title.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/ui/web_contents_forced_title.h
diff --git a/chrome/browser/chromeos/login/ui/web_contents_forced_title.h b/chrome/browser/chromeos/login/ui/web_contents_forced_title.h
new file mode 100644
index 0000000000000000000000000000000000000000..b12ebd2fee9dd0d4f36c417bb2a1aaecd9a3b999
--- /dev/null
+++ b/chrome/browser/chromeos/login/ui/web_contents_forced_title.h
@@ -0,0 +1,39 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEB_CONTENTS_FORCED_TITLE_H_
+#define CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEB_CONTENTS_FORCED_TITLE_H_
+
+#include "base/strings/string16.h"
+#include "content/public/browser/web_contents_observer.h"
+#include "content/public/browser/web_contents_user_data.h"
+
+namespace chromeos {
+
+// Ensures that the title of the WebContents instance this object is attached
+// to is always set to the given title value.
+class WebContentsForcedTitle
+ : public content::WebContentsObserver,
+ public content::WebContentsUserData<WebContentsForcedTitle> {
+ public:
+ static void CreateForWebContentsWithTitle(content::WebContents* web_contents,
+ const base::string16& title);
+
+ ~WebContentsForcedTitle() override;
+
+ private:
+ WebContentsForcedTitle(content::WebContents* web_contents,
+ const base::string16& title);
+
+ // content::WebContentsObserver:
+ void TitleWasSet(content::NavigationEntry* entry, bool explicit_set) override;
+
+ base::string16 title_;
+
+ DISALLOW_COPY_AND_ASSIGN(WebContentsForcedTitle);
+};
+
+} // namespace chromeos
+
+#endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEB_CONTENTS_FORCED_TITLE_H_
« no previous file with comments | « chrome/browser/chromeos/BUILD.gn ('k') | chrome/browser/chromeos/login/ui/web_contents_forced_title.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698