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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.cc

Issue 2817403002: [Omnibox] Elide omnibox text (Closed)
Patch Set: Add comment 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/omnibox/omnibox_view_views.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index 6fc3b895ef0ba5c89f7e333c373d373a25bd902d..31427b106b642902c488f220e211e33b9c5f6d62 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -138,6 +138,7 @@ OmniboxViewViews::~OmniboxViewViews() {
void OmniboxViewViews::Init() {
set_controller(this);
SetTextInputType(ui::TEXT_INPUT_TYPE_URL);
+ GetRenderText()->SetElideBehavior(gfx::ELIDE_TAIL);
if (popup_window_mode_)
SetReadOnly(true);
@@ -760,6 +761,8 @@ void OmniboxViewViews::OnFocus() {
saved_selection_for_focus_change_ = gfx::Range::InvalidRange();
}
+ GetRenderText()->SetElideBehavior(gfx::NO_ELIDE);
+
// Focus changes can affect the visibility of any keyword hint.
if (model()->is_keyword_hint())
location_bar_view_->Layout();
@@ -788,6 +791,8 @@ void OmniboxViewViews::OnBlur() {
// Make sure the beginning of the text is visible.
SelectRange(gfx::Range(0));
+ GetRenderText()->SetElideBehavior(gfx::ELIDE_TAIL);
+
// Focus changes can affect the visibility of any keyword hint.
if (model()->is_keyword_hint())
location_bar_view_->Layout();
« no previous file with comments | « no previous file | chrome/browser/ui/views/omnibox/omnibox_view_views_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698