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

Unified Diff: chrome/browser/ui/omnibox/chrome_omnibox_client.cc

Issue 2738003002: Add title to current page in zero suggest. (Closed)
Patch Set: Fix a nullptr problem that was crashing some UI tests. Created 3 years, 8 months 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
Index: chrome/browser/ui/omnibox/chrome_omnibox_client.cc
diff --git a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
index c6f224e697e7efc67d101755fdab2e35a536f370..2896ad6104179f93a0d79bb1e4dae3c9c792176a 100644
--- a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
+++ b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
@@ -151,7 +151,9 @@ const GURL& ChromeOmniboxClient::GetURL() const {
}
const base::string16& ChromeOmniboxClient::GetTitle() const {
- return controller_->GetWebContents()->GetTitle();
+ static const auto* const kEmptyTitle = new base::string16();
Peter Kasting 2017/04/27 00:33:57 Don't do this; return EmptyString16() below instea
gcomanici 2017/04/27 02:11:23 Done.
+ return CurrentPageExists() ? controller_->GetWebContents()->GetTitle()
+ : *kEmptyTitle;
}
gfx::Image ChromeOmniboxClient::GetFavicon() const {

Powered by Google App Engine
This is Rietveld 408576698