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

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

Issue 2345183002: Views: Draw Textfield selected text in gray when top-level Widget loses focus.
Patch Set: Refactor to use SelectionController(Delegate). Unfinished! Created 4 years, 1 month 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/label.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 246ac950545e87d55578e24d10f678da3cede533..7c45507e9b5b65dcb8c40262b82e5968355cd604 100644
--- a/ui/views/controls/textfield/textfield.h
+++ b/ui/views/controls/textfield/textfield.h
@@ -127,16 +127,15 @@ class VIEWS_EXPORT Textfield : public View,
void SetBackgroundColor(SkColor color);
void UseDefaultBackgroundColor();
- // Gets/sets the selection text color to be used when painting the Textfield.
- // Call UseDefaultSelectionTextColor() to restore the default system color.
- SkColor GetSelectionTextColor() const;
+ // Sets the selection text color to be used when painting the Textfield. Call
+ // UseDefaultSelectionTextColor() to restore the default system color. See
+ // SelectionControllerDelegate overrides for the getter.
void SetSelectionTextColor(SkColor color);
void UseDefaultSelectionTextColor();
- // Gets/sets the selection background color to be used when painting the
- // Textfield. Call UseDefaultSelectionBackgroundColor() to restore the default
- // system color.
- SkColor GetSelectionBackgroundColor() const;
+ // Sets the selection background color to be used when painting the Textfield.
+ // Call UseDefaultSelectionBackgroundColor() to restore the default system
+ // color. See SelectionControllerDelegate overrides for the getter.
void SetSelectionBackgroundColor(SkColor color);
void UseDefaultSelectionBackgroundColor();
@@ -244,6 +243,9 @@ class VIEWS_EXPORT Textfield : public View,
bool GetNeedsNotificationWhenVisibleBoundsChange() const override;
void OnVisibleBoundsChanged() override;
void OnEnabledChanged() override;
+ void ViewHierarchyChanged(
+ const ViewHierarchyChangedDetails& details) override;
+ void NativeViewHierarchyChanged() override;
void OnPaint(gfx::Canvas* canvas) override;
void OnFocus() override;
void OnBlur() override;
@@ -274,6 +276,9 @@ class VIEWS_EXPORT Textfield : public View,
// SelectionControllerDelegate overrides:
bool HasTextBeingDragged() const override;
+ SkColor GetSelectionTextColor() const override;
+ SkColor GetSelectionBackgroundColor() const override;
+ SkColor GetSelectionBackgroundUnfocusedColor() const override;
// ui::TouchEditable overrides:
void SelectRect(const gfx::Point& start, const gfx::Point& end) override;
@@ -364,6 +369,7 @@ class VIEWS_EXPORT Textfield : public View,
// return value.
bool PasteSelectionClipboard() override;
void UpdateSelectionClipboard() override;
+ void OnWillChangeFocus(View* focused_before, View* focused_now) override;
// Updates the painted background color.
void UpdateBackgroundColor();
« no previous file with comments | « ui/views/controls/label.cc ('k') | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698