summaryrefslogtreecommitdiffstats
path: root/views/widget/native_widget.h
diff options
context:
space:
mode:
authorsuzhe@google.com <suzhe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-01 22:05:14 +0000
committersuzhe@google.com <suzhe@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-01 22:05:14 +0000
commit6c8a4312deb82e599b2c9695b2ec22aa1e298271 (patch)
treeb524c5d2d193ca166da62b4906d19e899a850f47 /views/widget/native_widget.h
parent38788d94bc411c89d6a0bbebe6e0628e401e43e4 (diff)
downloadchromium_src-6c8a4312deb82e599b2c9695b2ec22aa1e298271.zip
chromium_src-6c8a4312deb82e599b2c9695b2ec22aa1e298271.tar.gz
chromium_src-6c8a4312deb82e599b2c9695b2ec22aa1e298271.tar.bz2
Integrate the new input method API for Views into Chromium.
This CL contains following changes: 1. Improve TextfieldViewsModel to support composition text. 2. Implement TextInputClient interface in NativeTextfieldViews. 3. Fix Textfield and native implementations to avoid calling TextfieldController::ContentsChanged() when the text is changed by calling Textfield::SetText() or AppendText(). 4. Fix a bug in FocusManager that causes NativeTextfieldViewsTest.FocusTraversalTest to fail. 5. Fix accelerator_handler_touch.cc to send key events to the top-level widget's input method instance instead of the root view. 6. Do the same fix in extension_input_api.cc. 7. Hook InputMethod into WidgetGtk and WidgetWin. BUG=75003 TEST=views_unittests --gtest_filter=NativeTextfieldViews* Review URL: http://codereview.chromium.org/6675005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80226 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/widget/native_widget.h')
-rw-r--r--views/widget/native_widget.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/views/widget/native_widget.h b/views/widget/native_widget.h
index 9b28ac7..d9a1184 100644
--- a/views/widget/native_widget.h
+++ b/views/widget/native_widget.h
@@ -20,6 +20,7 @@ class OSExchangeData;
namespace views {
+class InputMethod;
class TooltipManager;
class Widget;
@@ -81,6 +82,17 @@ class NativeWidget {
// Returns true if this native widget is capturing all events.
virtual bool HasMouseCapture() const = 0;
+ // Returns the InputMethod for this native widget.
+ // Note that all widgets in a widget hierarchy share the same input method.
+ // TODO(suzhe): rename to GetInputMethod() when NativeWidget implementation
+ // class doesn't inherit Widget anymore.
+ virtual InputMethod* GetInputMethodNative() = 0;
+
+ // Sets a different InputMethod instance to this native widget. The instance
+ // must not be initialized, the ownership will be assumed by the native
+ // widget. It's only for testing purpose.
+ virtual void ReplaceInputMethod(InputMethod* input_method) = 0;
+
protected:
friend class Widget;