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

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

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 | « ui/views/controls/focusable_border.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.h
diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h
index 1a28b12433f14585c7479c71f13c942e3e8595f9..55353ee8a4874498dbeff19c73dd9df4b11a7c6d 100644
--- a/ui/views/controls/textfield/textfield.h
+++ b/ui/views/controls/textfield/textfield.h
@@ -163,6 +163,10 @@ class VIEWS_EXPORT Textfield : public View,
placeholder_text_color_ = color;
}
+ // Sets whether to indicate the textfield has invalid content.
+ void SetInvalid(bool invalid);
+ bool invalid() const { return invalid_; }
+
// Get or set the horizontal alignment used for the button from the underlying
// RenderText object.
gfx::HorizontalAlignment GetHorizontalAlignment() const;
@@ -349,6 +353,9 @@ class VIEWS_EXPORT Textfield : public View,
// Updates the painted background color.
void UpdateBackgroundColor();
+ // Updates the border per the state of |invalid_|.
+ void UpdateBorder();
+
// Does necessary updates when the text and/or cursor position changes.
void UpdateAfterChange(bool text_changed, bool cursor_changed);
@@ -464,6 +471,10 @@ class VIEWS_EXPORT Textfield : public View,
// TODO(estade): remove this when Harmony/MD is default.
SkColor placeholder_text_color_;
+ // True when the contents are deemed unacceptable and should be indicated as
+ // such.
+ bool invalid_;
+
// The accessible name of the text field.
base::string16 accessible_name_;
« no previous file with comments | « ui/views/controls/focusable_border.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698