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

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

Issue 2435103002: Omnibox: Preserve display text and select all on a focus search (Closed)
Patch Set: Refactor Created 4 years, 2 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 0089256506337c24efc58b65dc839028a8342a46..97cd2816dbcbf37332c872548f5ae8c0d18cdfdc 100644
--- a/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
+++ b/chrome/browser/ui/omnibox/chrome_omnibox_client.cc
@@ -140,11 +140,12 @@ ChromeOmniboxClient::CreateOmniboxNavigationObserver(
}
bool ChromeOmniboxClient::CurrentPageExists() const {
- return (controller_->GetWebContents() != NULL);
+ return controller_->GetWebContents();
Peter Kasting 2016/10/25 20:21:27 This doesn't produce a "forcing to true/false (per
Tom (Use chromium acct) 2016/10/25 21:55:09 idk, I didn't run a dry run on this PS. Reverted j
}
const GURL& ChromeOmniboxClient::GetURL() const {
- return controller_->GetWebContents()->GetVisibleURL();
+ return CurrentPageExists() ? controller_->GetWebContents()->GetVisibleURL()
+ : GURL::EmptyGURL();
}
const base::string16& ChromeOmniboxClient::GetTitle() const {

Powered by Google App Engine
This is Rietveld 408576698