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

Unified Diff: ui/views/controls/textfield/textfield.cc

Issue 2383243002: Refactor MdFocusRing to make it easier to reuse on other controls. (Closed)
Patch Set: install 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
« no previous file with comments | « ui/views/controls/focusable_border.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index 4642d23fc89a89633cc84ff72fbb5011959a7b9d..7c7b03534634c075e20a209397b5897961b0bbcf 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -33,6 +33,7 @@
#include "ui/native_theme/native_theme.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/background.h"
+#include "ui/views/controls/focus_ring.h"
#include "ui/views/controls/focusable_border.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/menu/menu_runner.h"
@@ -990,6 +991,8 @@ void Textfield::OnFocus() {
StartBlinkingCursor();
View::OnFocus();
SchedulePaint();
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial())
+ FocusRing::Install(this);
}
void Textfield::OnBlur() {
@@ -1007,6 +1010,8 @@ void Textfield::OnBlur() {
// Border typically draws focus indicator.
SchedulePaint();
+ if (ui::MaterialDesignController::IsSecondaryUiMaterial())
+ FocusRing::Uninstall(this);
}
gfx::Point Textfield::GetKeyboardContextMenuLocation() {
« no previous file with comments | « ui/views/controls/focusable_border.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698