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

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

Issue 5988010: focus reverse traversal was not working for TextfieldViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: explicitly forward key/focus event to TextfieldViews Created 9 years, 12 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
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);
};

Powered by Google App Engine
This is Rietveld 408576698