Chromium Code Reviews| Index: views/controls/textfield/native_textfield_wrapper.h |
| diff --git a/views/controls/textfield/native_textfield_wrapper.h b/views/controls/textfield/native_textfield_wrapper.h |
| index eb5245fd7baf4f17f5d1d4ad412374a4d2aae9f9..8f347fa22abfd4024f08262aaa17dd3096f3d770 100644 |
| --- a/views/controls/textfield/native_textfield_wrapper.h |
| +++ b/views/controls/textfield/native_textfield_wrapper.h |
| @@ -15,6 +15,7 @@ class Insets; |
| namespace views { |
| +class KeyEvent; |
| class Textfield; |
| class View; |
| @@ -77,8 +78,9 @@ class NativeTextfieldWrapper { |
| // Updates the vertical margins for the native text field. |
| virtual void UpdateVerticalMargins() = 0; |
| - // Sets the focus to the text field. |
| - virtual void SetFocus() = 0; |
| + // Sets the focus to the text field. Returns fale if the wrapper |
|
sky
2011/01/05 22:57:35
fale -> false
|
| + // didn't take focus. |
| + virtual bool SetFocus() = 0; |
| // Retrieves the views::View that hosts the native control. |
| virtual View* GetView() = 0; |
| @@ -89,6 +91,15 @@ class NativeTextfieldWrapper { |
| // Returns whether or not an IME is composing text. |
| virtual bool IsIMEComposing() const = 0; |
| + // Following methods are to forward key/focus related events to the |
| + // views wrapper so that TextfieldViews can handle key inputs without |
| + // having a focus. See views::View for the description of each method. |
| + virtual bool OnKeyPressed(const views::KeyEvent& e) = 0; |
|
sky
2011/01/05 22:57:35
I'm a bit worried about naming these exactly the s
|
| + virtual bool OnKeyReleased(const views::KeyEvent& e) = 0; |
| + virtual void WillGainFocus() = 0; |
| + virtual void DidGainFocus() = 0; |
| + virtual void WillLoseFocus() = 0; |
| + |
| // Creates an appropriate NativeTextfieldWrapper for the platform. |
| static NativeTextfieldWrapper* CreateWrapper(Textfield* field); |
| }; |