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

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: Use display_text.length() as caret pos for KEYBOARD_SHORTCUT 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..faa180d86be6d066dbe5521146b5348ac27c12cb 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() != nullptr);
}
const GURL& ChromeOmniboxClient::GetURL() const {
- return controller_->GetWebContents()->GetVisibleURL();
+ return CurrentPageExists() ? controller_->GetWebContents()->GetVisibleURL()
+ : GURL::EmptyGURL();
}
const base::string16& ChromeOmniboxClient::GetTitle() const {
« no previous file with comments | « chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm ('k') | chrome/browser/ui/omnibox/omnibox_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698