Chromium Code Reviews| Index: ui/views/controls/textfield/textfield.h |
| diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h |
| index 55353ee8a4874498dbeff19c73dd9df4b11a7c6d..29a9a5e3780631504a13ebdbfe1b16abc635b416 100644 |
| --- a/ui/views/controls/textfield/textfield.h |
| +++ b/ui/views/controls/textfield/textfield.h |
| @@ -29,6 +29,7 @@ |
| #include "ui/views/context_menu_controller.h" |
| #include "ui/views/controls/textfield/textfield_model.h" |
| #include "ui/views/drag_controller.h" |
| +#include "ui/views/focus/focus_manager.h" |
| #include "ui/views/view.h" |
| #include "ui/views/word_lookup_client.h" |
| @@ -43,6 +44,7 @@ class VIEWS_EXPORT Textfield : public View, |
| public TextfieldModel::Delegate, |
| public ContextMenuController, |
| public DragController, |
| + public FocusChangeListener, |
| public WordLookupClient, |
| public ui::TouchEditable, |
| public ui::TextInputClient { |
| @@ -137,6 +139,10 @@ class VIEWS_EXPORT Textfield : public View, |
| void SetSelectionBackgroundColor(SkColor color); |
| void UseDefaultSelectionBackgroundColor(); |
| + // Gets the selection background color for use when the Textfield was the last |
| + // to be focused in a widget. |
| + SkColor GetUnfocusedSelectionBackgroundColor() const; |
| + |
| // Set drop shadows underneath the text. |
| void SetShadows(const gfx::ShadowValues& shadows); |
| @@ -242,6 +248,8 @@ class VIEWS_EXPORT Textfield : public View, |
| bool GetNeedsNotificationWhenVisibleBoundsChange() const override; |
| void OnVisibleBoundsChanged() override; |
| void OnEnabledChanged() override; |
| + void ViewHierarchyChanged( |
| + const ViewHierarchyChangedDetails& details) override; |
| void OnPaint(gfx::Canvas* canvas) override; |
| void OnFocus() override; |
| void OnBlur() override; |
| @@ -265,6 +273,13 @@ class VIEWS_EXPORT Textfield : public View, |
| const gfx::Point& press_pt, |
| const gfx::Point& p) override; |
| + // FocusChangeListener overrides: |
| + void OnWillChangeFocus(View* focused_before, View* focused_now) override; |
| + void OnDidChangeFocus(View* focused_before, View* focused_now) override; |
| +#if !defined(OS_MACOSX) |
| + void OnFocusManagerDestroying() override; |
| +#endif |
| + |
| // WordLookupClient overrides: |
| bool GetDecoratedWordAtPoint(const gfx::Point& point, |
| gfx::DecoratedText* decorated_word, |
| @@ -464,6 +479,12 @@ class VIEWS_EXPORT Textfield : public View, |
| SkColor selection_text_color_; |
| SkColor selection_background_color_; |
| + // In cases where the Widget is deleted before the Textfield, there is no |
| + // longer a way to retrieve the FocusManager. It's still needed to remove this |
| + // Textfield as an observer, so keep a reference to the FocusManager this |
| + // Textfield is listening to, if any. |
| + FocusManager* focus_manager_; |
|
tapted
2016/10/24 03:11:19
I don't think OWNERS will like this :/ Let's see i
tapted
2016/10/24 06:04:16
I thought more about this. I think the data member
Patti Lor
2016/10/27 00:17:27
The cleanup in the destructor actually didn't have
|
| + |
| // Text to display when empty. |
| base::string16 placeholder_text_; |