| Index: ui/views/controls/textfield/textfield.cc
|
| diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
|
| index 7c7b03534634c075e20a209397b5897961b0bbcf..4dde2b03a89032a87b0c57a198d7cb0539810b72 100644
|
| --- a/ui/views/controls/textfield/textfield.cc
|
| +++ b/ui/views/controls/textfield/textfield.cc
|
| @@ -983,16 +983,19 @@ void Textfield::OnFocus() {
|
| GetRenderText()->set_focused(true);
|
| if (ShouldShowCursor())
|
| GetRenderText()->set_cursor_visible(true);
|
| - SchedulePaint();
|
| if (GetInputMethod())
|
| GetInputMethod()->SetFocusedTextInputClient(this);
|
| OnCaretBoundsChanged();
|
| if (ShouldBlinkCursor())
|
| StartBlinkingCursor();
|
| - View::OnFocus();
|
| - SchedulePaint();
|
| - if (ui::MaterialDesignController::IsSecondaryUiMaterial())
|
| + // Pre Harmony, the border typically draws focus indicator. If there's no
|
| + // border, there should be no focus indicator (e.g. in the omnibox).
|
| + if (ui::MaterialDesignController::IsSecondaryUiMaterial() &&
|
| + border() && border()->ShouldAddFocusRing()) {
|
| FocusRing::Install(this);
|
| + }
|
| + SchedulePaint();
|
| + View::OnFocus();
|
| }
|
|
|
| void Textfield::OnBlur() {
|
| @@ -1008,10 +1011,12 @@ void Textfield::OnBlur() {
|
|
|
| DestroyTouchSelection();
|
|
|
| - // Border typically draws focus indicator.
|
| - SchedulePaint();
|
| - if (ui::MaterialDesignController::IsSecondaryUiMaterial())
|
| + if (ui::MaterialDesignController::IsSecondaryUiMaterial() &&
|
| + border() && border()->ShouldAddFocusRing()) {
|
| FocusRing::Uninstall(this);
|
| + }
|
| + SchedulePaint();
|
| + View::OnBlur();
|
| }
|
|
|
| gfx::Point Textfield::GetKeyboardContextMenuLocation() {
|
|
|