Title: [93827] trunk/Source/WebKit2
Revision
93827
Author
[email protected]
Date
2011-08-25 15:54:47 -0700 (Thu, 25 Aug 2011)

Log Message

WKView should keep track of the plug-in complex text input state
https://bugs.webkit.org/show_bug.cgi?id=66990

Reviewed by Sam Weinig.

* UIProcess/API/mac/WKView.mm:
Add a _pluginComplexTextInputState ivar to WKViewData.

(-[WKView _setPluginComplexTextInputState:]):
Set the _pluginComplexTextInputState variable. If text input is being disabled, send back an empty string to the plug-in.

(-[WKView _setPluginComplexTextInputState:WebKit::pluginComplexTextInputIdentifier:]):
Call -[WKView _setPluginComplexTextInputState:].

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (93826 => 93827)


--- trunk/Source/WebKit2/ChangeLog	2011-08-25 22:34:36 UTC (rev 93826)
+++ trunk/Source/WebKit2/ChangeLog	2011-08-25 22:54:47 UTC (rev 93827)
@@ -1,5 +1,21 @@
 2011-08-25  Anders Carlsson  <[email protected]>
 
+        WKView should keep track of the plug-in complex text input state
+        https://bugs.webkit.org/show_bug.cgi?id=66990
+
+        Reviewed by Sam Weinig.
+
+        * UIProcess/API/mac/WKView.mm:
+        Add a _pluginComplexTextInputState ivar to WKViewData.
+
+        (-[WKView _setPluginComplexTextInputState:]):
+        Set the _pluginComplexTextInputState variable. If text input is being disabled, send back an empty string to the plug-in.
+
+        (-[WKView _setPluginComplexTextInputState:WebKit::pluginComplexTextInputIdentifier:]):
+        Call -[WKView _setPluginComplexTextInputState:].
+
+2011-08-25  Anders Carlsson  <[email protected]>
+
         Move file internal methods to a class continuation in WKView
         https://bugs.webkit.org/show_bug.cgi?id=66983
 

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (93826 => 93827)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2011-08-25 22:34:36 UTC (rev 93826)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2011-08-25 22:54:47 UTC (rev 93827)
@@ -112,6 +112,7 @@
 @interface WKView ()
 - (float)_deviceScaleFactor;
 - (void)_setDrawingAreaSize:(NSSize)size;
+- (void)_setPluginComplexTextInputState:(PluginComplexTextInputState)pluginComplexTextInputState;
 @end
 
 @interface WKViewData : NSObject {
@@ -145,6 +146,9 @@
     // The identifier of the plug-in we want to send complex text input to, or 0 if there is none.
     uint64_t _pluginComplexTextInputIdentifier;
 
+    // The state of complex text input for the plug-in.
+    PluginComplexTextInputState _pluginComplexTextInputState;
+
     bool _inBecomeFirstResponder;
     bool _inResignFirstResponder;
     NSEvent *_mouseDownEvent;
@@ -386,6 +390,17 @@
     [super renewGState];
 }
 
+- (void)_setPluginComplexTextInputState:(PluginComplexTextInputState)pluginComplexTextInputState
+{
+    _data->_pluginComplexTextInputState = pluginComplexTextInputState;
+    
+    if (_data->_pluginComplexTextInputState != PluginComplexTextInputDisabled)
+        return;
+
+    // Send back an empty string to the plug-in. This will disable text input.
+    _data->_page->sendComplexTextInputToPlugin(_data->_pluginComplexTextInputIdentifier, String());
+}
+
 typedef HashMap<SEL, String> SelectorNameMap;
 
 // Map selectors into Editor command names.
@@ -2369,7 +2384,7 @@
         return;
     }
 
-    // FIXME: Actually update the state here when using the new Cocoa text input model.
+    [self _setPluginComplexTextInputState:pluginComplexTextInputState];
 }
 
 - (void)_setPageHasCustomRepresentation:(BOOL)pageHasCustomRepresentation
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to