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

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

Issue 2817403002: [Omnibox] Elide omnibox text (Closed)
Patch Set: Address pkasting's review 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..728a4c53f47c9a522cea1a53530d824678cb5c1f 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);
@@ -750,6 +751,7 @@ bool OmniboxViewViews::HandleAccessibleAction(
void OmniboxViewViews::OnFocus() {
views::Textfield::OnFocus();
+ GetRenderText()->SetElideBehavior(gfx::NO_ELIDE);
Peter Kasting 2017/04/17 20:00:03 Nit: Now that I think about it I might move these
simonhong 2017/04/17 20:06:34 Done.
// TODO(oshima): Get control key state.
model()->OnSetFocus(false);
// Don't call controller()->OnSetFocus, this view has already acquired focus.
@@ -770,6 +772,7 @@ void OmniboxViewViews::OnBlur() {
saved_selection_for_focus_change_ = GetSelectedRange();
views::Textfield::OnBlur();
+ GetRenderText()->SetElideBehavior(gfx::ELIDE_TAIL);
model()->OnWillKillFocus();
// If ZeroSuggest is active, we may have refused to show an update to the
« 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