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

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

Issue 2406363003: Update appearance of invalid textfields in Harmony. (Closed)
Patch Set: combine install with setcolorid 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 | « chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc ('k') | ui/views/controls/focus_ring.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/combobox/combobox.cc
diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc
index 2c26c8fb313d7bbf6713667246dcc26e5741442b..b3212d048e4d1042d7040b50b518e389d52e2730 100644
--- a/ui/views/controls/combobox/combobox.cc
+++ b/ui/views/controls/combobox/combobox.cc
@@ -507,6 +507,11 @@ void Combobox::SetInvalid(bool invalid) {
invalid_ = invalid;
+ if (HasFocus() && UseMd()) {
+ FocusRing::Install(this, invalid_
+ ? ui::NativeTheme::kColorId_AlertSeverityHigh
+ : ui::NativeTheme::kColorId_NumColors);
+ }
UpdateBorder();
SchedulePaint();
}
@@ -710,8 +715,11 @@ void Combobox::OnFocus() {
View::OnFocus();
// Border renders differently when focused.
SchedulePaint();
- if (UseMd())
- FocusRing::Install(this);
+ if (UseMd()) {
+ FocusRing::Install(this, invalid_
+ ? ui::NativeTheme::kColorId_AlertSeverityHigh
+ : ui::NativeTheme::kColorId_NumColors);
+ }
}
void Combobox::OnBlur() {
@@ -765,7 +773,7 @@ void Combobox::UpdateBorder() {
if (style_ == STYLE_ACTION)
border->SetInsets(5, 10, 5, 10);
if (invalid_)
- border->SetColor(gfx::kGoogleRed700);
+ border->SetColorId(ui::NativeTheme::kColorId_AlertSeverityHigh);
SetBorder(std::move(border));
}
« no previous file with comments | « chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc ('k') | ui/views/controls/focus_ring.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698