| OLD | NEW |
| (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 #ifndef CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEB_CONTENTS_FORCED_TITLE_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEB_CONTENTS_FORCED_TITLE_H_ |
| 7 |
| 8 #include "base/strings/string16.h" |
| 9 #include "content/public/browser/web_contents_observer.h" |
| 10 #include "content/public/browser/web_contents_user_data.h" |
| 11 |
| 12 namespace chromeos { |
| 13 |
| 14 // Ensures that the title of the WebContents instance this object is attached |
| 15 // to is always set to the given title value. |
| 16 class WebContentsForcedTitle |
| 17 : public content::WebContentsObserver, |
| 18 public content::WebContentsUserData<WebContentsForcedTitle> { |
| 19 public: |
| 20 static void CreateForWebContentsWithTitle(content::WebContents* web_contents, |
| 21 const base::string16& title); |
| 22 |
| 23 ~WebContentsForcedTitle() override; |
| 24 |
| 25 private: |
| 26 WebContentsForcedTitle(content::WebContents* web_contents, |
| 27 const base::string16& title); |
| 28 |
| 29 // content::WebContentsObserver: |
| 30 void TitleWasSet(content::NavigationEntry* entry, bool explicit_set) override; |
| 31 |
| 32 base::string16 title_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(WebContentsForcedTitle); |
| 35 }; |
| 36 |
| 37 } // namespace chromeos |
| 38 |
| 39 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_WEB_CONTENTS_FORCED_TITLE_H_ |
| OLD | NEW |