| Index: ui/views/controls/textfield/textfield.h
|
| diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h
|
| index 44b37d2c19e070e2892219a432fe0fe45205e17c..bfbd16e32b2da1fc4cbdcb18d2d9a5660ebc80af 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/selection_controller.h"
|
| #include "ui/views/selection_controller_delegate.h"
|
| #include "ui/views/view.h"
|
| @@ -45,6 +46,7 @@ class VIEWS_EXPORT Textfield : public View,
|
| public TextfieldModel::Delegate,
|
| public ContextMenuController,
|
| public DragController,
|
| + public FocusChangeListener,
|
| public WordLookupClient,
|
| public SelectionControllerDelegate,
|
| public ui::TouchEditable,
|
| @@ -140,6 +142,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);
|
|
|
| @@ -243,6 +249,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;
|
| @@ -266,6 +275,10 @@ 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;
|
| +
|
| // WordLookupClient overrides:
|
| bool GetDecoratedWordAtPoint(const gfx::Point& point,
|
| gfx::DecoratedText* decorated_word,
|
| @@ -363,6 +376,11 @@ class VIEWS_EXPORT Textfield : public View,
|
| bool PasteSelectionClipboard() override;
|
| void UpdateSelectionClipboard() override;
|
|
|
| + // Adds this Textfield as a FocusChangeListener based on |add_as_listener|.
|
| + // Always removes this Textfield as a listener of the previously listened-to
|
| + // focus manager (if it exists) before this happens.
|
| + void ObserveWidgetFocusChanges(bool add_as_listener);
|
| +
|
| // Handles a request to change the value of this text field from software
|
| // using an accessibility API (typically automation software, screen readers
|
| // don't normally use this). If |clear_first| is true, this replaces all text
|
| @@ -472,6 +490,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_;
|
| +
|
| // Text to display when empty.
|
| base::string16 placeholder_text_;
|
|
|
|
|