Diff
Modified: trunk/Source/WebKit2/ChangeLog (93446 => 93447)
--- trunk/Source/WebKit2/ChangeLog 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/ChangeLog 2011-08-19 22:50:47 UTC (rev 93447)
@@ -1,3 +1,51 @@
+2011-08-19 Anders Carlsson <[email protected]>
+
+ Make the complex text input state a tri-state enum instead of a boolean
+ https://bugs.webkit.org/show_bug.cgi?id=62245
+
+ Reviewed by Sam Weinig.
+
+ This is to prepare the infrastructure for supporting the updated Cocoa text input model for plug-ins.
+
+ * PluginProcess/PluginControllerProxy.cpp:
+ * PluginProcess/PluginControllerProxy.h:
+ * PluginProcess/mac/PluginControllerProxyMac.mm:
+ (WebKit::PluginControllerProxy::setComplexTextInputState):
+ (WebKit::PluginControllerProxy::compositingRenderServerPort):
+ * Shared/Plugins/mac: Added.
+ * Shared/Plugins/mac/PluginComplexTextInputState.h: Added.
+ (WebKit::isValidPluginComplexTextInputState):
+ * UIProcess/API/mac/PageClientImpl.h:
+ * UIProcess/API/mac/PageClientImpl.mm:
+ (WebKit::PageClientImpl::setPluginComplexTextInputState):
+ * UIProcess/API/mac/WKView.mm:
+ (-[WKView _setPluginComplexTextInputState:WebKit::pluginComplexTextInputIdentifier:]):
+ * UIProcess/API/mac/WKViewInternal.h:
+ * UIProcess/PageClient.h:
+ * UIProcess/WebPageProxy.h:
+ * UIProcess/WebPageProxy.messages.in:
+ * UIProcess/mac/WebPageProxyMac.mm:
+ (WebKit::WebPageProxy::setPluginComplexTextInputState):
+ * WebKit2.xcodeproj/project.pbxproj:
+ * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+ (WebKit::NetscapePlugin::NetscapePlugin):
+ * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+ * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
+ (WebKit::NetscapePlugin::platformSetFocus):
+ (WebKit::NetscapePlugin::windowFocusChanged):
+ (WebKit::NetscapePlugin::setComplexTextInputEnabled):
+ * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
+ (WebKit::PluginProxy::setComplexTextInputState):
+ * WebProcess/Plugins/PluginController.h:
+ * WebProcess/Plugins/PluginProxy.cpp:
+ * WebProcess/Plugins/PluginProxy.h:
+ * WebProcess/Plugins/PluginProxy.messages.in:
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::~PluginView):
+ (WebKit::PluginView::setComplexTextInputState):
+ (WebKit::PluginView::compositingRenderServerPort):
+ * WebProcess/Plugins/PluginView.h:
+
2011-08-19 Caio Marcelo de Oliveira Filho <[email protected]>
[Qt] [WK2] Provide API for intercept (and possible ignore) links clicked in QDesktopWebView
Modified: trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp (93446 => 93447)
--- trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp 2011-08-19 22:50:47 UTC (rev 93447)
@@ -361,23 +361,6 @@
ASSERT_NOT_REACHED();
}
-#if PLATFORM(MAC)
-void PluginControllerProxy::setComplexTextInputEnabled(bool complexTextInputEnabled)
-{
- if (m_isComplexTextInputEnabled == complexTextInputEnabled)
- return;
-
- m_isComplexTextInputEnabled = complexTextInputEnabled;
-
- m_connection->connection()->send(Messages::PluginProxy::SetComplexTextInputEnabled(complexTextInputEnabled), m_pluginInstanceID);
-}
-
-mach_port_t PluginControllerProxy::compositingRenderServerPort()
-{
- return PluginProcess::shared().compositingRenderServerPort();
-}
-#endif
-
String PluginControllerProxy::proxiesForURL(const String& urlString)
{
String proxyString;
Modified: trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h (93446 => 93447)
--- trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h 2011-08-19 22:50:47 UTC (rev 93447)
@@ -96,7 +96,7 @@
virtual void willSendEventToPlugin();
#if PLATFORM(MAC)
- virtual void setComplexTextInputEnabled(bool);
+ virtual void setComplexTextInputState(PluginComplexTextInputState);
virtual mach_port_t compositingRenderServerPort();
#endif
Modified: trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm (93446 => 93447)
--- trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm 2011-08-19 22:50:47 UTC (rev 93447)
@@ -28,14 +28,26 @@
#if ENABLE(PLUGIN_PROCESS)
-#import <QuartzCore/QuartzCore.h>
#import "PluginProcess.h"
+#import "PluginProxyMessages.h"
#import "WebKitSystemInterface.h"
+#import "WebProcessConnection.h"
+#import <QuartzCore/QuartzCore.h>
using namespace WebCore;
namespace WebKit {
+void PluginControllerProxy::setComplexTextInputState(PluginComplexTextInputState pluginComplexTextInputState)
+{
+ m_connection->connection()->send(Messages::PluginProxy::SetComplexTextInputState(pluginComplexTextInputState), m_pluginInstanceID);
+}
+
+mach_port_t PluginControllerProxy::compositingRenderServerPort()
+{
+ return PluginProcess::shared().compositingRenderServerPort();
+}
+
void PluginControllerProxy::platformInitialize()
{
CALayer * platformLayer = m_plugin->pluginLayer();
Added: trunk/Source/WebKit2/Shared/Plugins/mac/PluginComplexTextInputState.h (0 => 93447)
--- trunk/Source/WebKit2/Shared/Plugins/mac/PluginComplexTextInputState.h (rev 0)
+++ trunk/Source/WebKit2/Shared/Plugins/mac/PluginComplexTextInputState.h 2011-08-19 22:50:47 UTC (rev 93447)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PluginComplexTextInputState_h
+#define PluginComplexTextInputState_h
+
+namespace WebKit {
+
+enum PluginComplexTextInputState {
+ // Complex text input is disabled.
+ PluginComplexTextInputDisabled,
+
+ // Complex text input is enabled using the updated Cocoa event model text
+ // input handling specification described at https://wiki.mozilla.org/NPAPI:CocoaEventModel#Text_Input
+ PluginComplexTextInputEnabled,
+
+ // Complex text input is enabled using the legacy Cocoa/Carbon event model text
+ // input handling that matches WebKit1.
+ PluginComplexTextInputEnabledLegacy
+};
+
+static inline bool isValidPluginComplexTextInputState(uint64_t value)
+{
+ switch (value) {
+ case PluginComplexTextInputDisabled:
+ case PluginComplexTextInputEnabled:
+ case PluginComplexTextInputEnabledLegacy:
+ return true;
+ }
+
+ return false;
+}
+
+} // namespace WebKit
+
+#endif // PluginComplexTextInputState_h
Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h (93446 => 93447)
--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h 2011-08-19 22:50:47 UTC (rev 93447)
@@ -94,7 +94,7 @@
virtual void exitAcceleratedCompositingMode();
virtual void accessibilityWebProcessTokenReceived(const CoreIPC::DataReference&);
- virtual void setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled);
+ virtual void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState);
virtual void makeFirstResponder();
Modified: trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm (93446 => 93447)
--- trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm 2011-08-19 22:50:47 UTC (rev 93447)
@@ -342,9 +342,9 @@
}
#endif // USE(ACCELERATED_COMPOSITING)
-void PageClientImpl::setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled)
+void PageClientImpl::setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState pluginComplexTextInputState)
{
- [m_wkView _setComplexTextInputEnabled:complexTextInputEnabled pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier];
+ [m_wkView _setPluginComplexTextInputState:pluginComplexTextInputState pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier];
}
CGContextRef PageClientImpl::containingWindowGraphicsContext()
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (93446 => 93447)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm 2011-08-19 22:50:47 UTC (rev 93447)
@@ -2285,9 +2285,10 @@
[self _updateRemoteAccessibilityRegistration:YES];
}
-- (void)_setComplexTextInputEnabled:(BOOL)complexTextInputEnabled pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier
+- (void)_setPluginComplexTextInputState:(WebKit::PluginComplexTextInputState)pluginComplexTextInputState pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier
{
BOOL inputSourceChanged = _data->_pluginComplexTextInputIdentifier;
+ BOOL complexTextInputEnabled = (pluginComplexTextInputState == PluginComplexTextInputEnabledLegacy);
if (complexTextInputEnabled) {
// Check if we're already allowing text input for this plug-in.
Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h (93446 => 93447)
--- trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h 2011-08-19 22:50:47 UTC (rev 93447)
@@ -23,6 +23,7 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/
+#import "PluginComplexTextInputState.h"
#import "WKView.h"
#import "WebFindOptions.h"
#import <wtf/Forward.h>
@@ -65,7 +66,7 @@
- (void)_exitAcceleratedCompositingMode;
- (void)_setAccessibilityWebProcessToken:(NSData *)data;
-- (void)_setComplexTextInputEnabled:(BOOL)complexTextInputEnabled pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier;
+- (void)_setPluginComplexTextInputState:(WebKit::PluginComplexTextInputState)pluginComplexTextInputState pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier;
- (void)_setPageHasCustomRepresentation:(BOOL)pageHasCustomRepresentation;
- (void)_didFinishLoadingDataForCustomRepresentationWithSuggestedFilename:(const String&)suggestedFilename dataReference:(const CoreIPC::DataReference&)dataReference;
Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (93446 => 93447)
--- trunk/Source/WebKit2/UIProcess/PageClient.h 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h 2011-08-19 22:50:47 UTC (rev 93447)
@@ -26,6 +26,7 @@
#ifndef PageClient_h
#define PageClient_h
+#include "PluginComplexTextInputState.h"
#include "ShareableBitmap.h"
#include "WebPageProxy.h"
#include "WebPopupMenuProxy.h"
@@ -162,7 +163,7 @@
#endif
#if PLATFORM(MAC)
- virtual void setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled) = 0;
+ virtual void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState) = 0;
virtual CGContextRef containingWindowGraphicsContext() = 0;
virtual void didPerformDictionaryLookup(const String&, double scaleFactor, const DictionaryPopupInfo&) = 0;
virtual void dismissDictionaryLookupPanel() = 0;
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (93446 => 93447)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h 2011-08-19 22:50:47 UTC (rev 93447)
@@ -766,7 +766,7 @@
void didFinishLoadingDataForCustomRepresentation(const String& suggestedFilename, const CoreIPC::DataReference&);
#if PLATFORM(MAC)
- void setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled);
+ void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
#endif
void clearPendingAPIRequestURL() { m_pendingAPIRequestURL = String(); }
Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (93446 => 93447)
--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in 2011-08-19 22:50:47 UTC (rev 93447)
@@ -229,7 +229,7 @@
RegisterWebProcessAccessibilityToken(CoreIPC::DataReference data)
# Plug-in complex text input support messages
- SetComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled)
+ SetPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState)
# Speech messages
GetIsSpeaking() -> (bool isSpeaking)
Modified: trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm (93446 => 93447)
--- trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm 2011-08-19 22:50:47 UTC (rev 93447)
@@ -31,6 +31,7 @@
#import "DictionaryPopupInfo.h"
#import "EditorState.h"
#import "NativeWebKeyboardEvent.h"
+#import "PluginComplexTextInputState.h"
#import "PageClient.h"
#import "PageClientImpl.h"
#import "TextChecker.h"
@@ -42,6 +43,8 @@
- (void)speakString:(NSString *)string;
@end
+#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, process()->connection())
+
using namespace WebCore;
namespace WebKit {
@@ -339,9 +342,11 @@
process()->send(Messages::WebPage::RegisterUIProcessAccessibilityTokens(elementToken, windowToken), m_pageID);
}
-void WebPageProxy::setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled)
+void WebPageProxy::setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t pluginComplexTextInputState)
{
- m_pageClient->setComplexTextInputEnabled(pluginComplexTextInputIdentifier, complexTextInputEnabled);
+ MESSAGE_CHECK(isValidPluginComplexTextInputState(pluginComplexTextInputState));
+
+ m_pageClient->setPluginComplexTextInputState(pluginComplexTextInputIdentifier, static_cast<PluginComplexTextInputState>(pluginComplexTextInputState));
}
void WebPageProxy::executeSavedCommandBySelector(const String& selector, bool& handled)
Modified: trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (93446 => 93447)
--- trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj 2011-08-19 22:50:47 UTC (rev 93447)
@@ -174,6 +174,7 @@
1A91010B1268C8CA001842F5 /* FindIndicatorWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */; };
1A92DC1112F8BA460017AF65 /* LayerTreeContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */; };
1A92DC1312F8BAB90017AF65 /* LayerTreeContextMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A92DC1212F8BAB90017AF65 /* LayerTreeContextMac.mm */; };
+ 1A9FBA8D13FF04E600DEED67 /* PluginComplexTextInputState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9FBA8C13FF04E600DEED67 /* PluginComplexTextInputState.h */; };
1AA1CC5D100FA1A10078DEBC /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */; };
1AA1CD07100FA1BA0078DEBC /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CD06100FA1BA0078DEBC /* Carbon.framework */; };
1AA2E51D12E4C05E00BC4966 /* CGUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA2E51B12E4C05E00BC4966 /* CGUtilities.h */; };
@@ -1086,6 +1087,7 @@
1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = FindIndicatorWindow.mm; sourceTree = "<group>"; };
1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerTreeContext.h; sourceTree = "<group>"; };
1A92DC1212F8BAB90017AF65 /* LayerTreeContextMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LayerTreeContextMac.mm; sourceTree = "<group>"; };
+ 1A9FBA8C13FF04E600DEED67 /* PluginComplexTextInputState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginComplexTextInputState.h; sourceTree = "<group>"; };
1AA1C79A100E7FC50078DEBC /* WebCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1AA1C7DE100E846E0078DEBC /* _javascript_Core.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = _javascript_Core.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
@@ -2107,6 +2109,14 @@
path = mac;
sourceTree = "<group>";
};
+ 1A9FBA8B13FF04E600DEED67 /* mac */ = {
+ isa = PBXGroup;
+ children = (
+ 1A9FBA8C13FF04E600DEED67 /* PluginComplexTextInputState.h */,
+ );
+ path = mac;
+ sourceTree = "<group>";
+ };
1AA2E51A12E4C05600BC4966 /* cg */ = {
isa = PBXGroup;
children = (
@@ -2241,6 +2251,7 @@
1AAE058C1279DCD400852418 /* Plugins */ = {
isa = PBXGroup;
children = (
+ 1A9FBA8B13FF04E600DEED67 /* mac */,
1A4A9C5212B816CF008FE984 /* Netscape */,
1A3D60FF13A7CC2A00F95D4E /* PluginModuleInfo.cpp */,
1A3D610013A7CC2A00F95D4E /* PluginModuleInfo.h */,
@@ -3810,6 +3821,7 @@
93C01DAC139AC91700ED51D7 /* CoreIPCClientRunLoop.h in Headers */,
1A3D610213A7CC2A00F95D4E /* PluginModuleInfo.h in Headers */,
5D51845613BCF9CC00C7FF4A /* APIClientTraits.h in Headers */,
+ 1A9FBA8D13FF04E600DEED67 /* PluginComplexTextInputState.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp (93446 => 93447)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp 2011-08-19 22:50:47 UTC (rev 93447)
@@ -75,6 +75,7 @@
, m_currentMouseEvent(0)
, m_pluginHasFocus(false)
, m_windowHasFocus(false)
+ , m_isComplexTextInputEnabled(false)
#ifndef NP_NO_CARBON
, m_nullEventTimer(RunLoop::main(), this, &NetscapePlugin::nullEventTimerFired)
, m_npCGContext()
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h (93446 => 93447)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h 2011-08-19 22:50:47 UTC (rev 93447)
@@ -190,6 +190,8 @@
virtual uint64_t pluginComplexTextInputIdentifier() const;
virtual void sendComplexTextInput(const String& textInput);
+
+ void setComplexTextInputEnabled(bool);
#endif
virtual void privateBrowsingStateChanged(bool);
@@ -239,6 +241,9 @@
bool m_pluginHasFocus;
bool m_windowHasFocus;
+ // Whether complex text input is enabled.
+ bool m_isComplexTextInputEnabled;
+
WebCore::IntRect m_windowFrameInScreenCoordinates;
WebCore::IntRect m_viewFrameInWindowCoordinates;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm (93446 => 93447)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm 2011-08-19 22:50:47 UTC (rev 93447)
@@ -787,7 +787,7 @@
void NetscapePlugin::platformSetFocus(bool hasFocus)
{
m_pluginHasFocus = hasFocus;
- controller()->setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
+ setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
switch (m_eventModel) {
case NPEventModelCocoa: {
@@ -815,7 +815,7 @@
void NetscapePlugin::windowFocusChanged(bool hasFocus)
{
m_windowHasFocus = hasFocus;
- controller()->setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
+ setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
switch (m_eventModel) {
case NPEventModelCocoa: {
@@ -975,6 +975,15 @@
}
}
+void NetscapePlugin::setComplexTextInputEnabled(bool complexTextInputEnabled)
+{
+ if (m_isComplexTextInputEnabled == complexTextInputEnabled)
+ return;
+
+ m_isComplexTextInputEnabled = complexTextInputEnabled;
+ controller()->setComplexTextInputState(complexTextInputEnabled ? PluginComplexTextInputEnabledLegacy : PluginComplexTextInputDisabled);
+}
+
PlatformLayer* NetscapePlugin::pluginLayer()
{
return static_cast<PlatformLayer*>(m_pluginLayer.get());
Modified: trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm (93446 => 93447)
--- trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm 2011-08-19 22:50:47 UTC (rev 93447)
@@ -28,6 +28,7 @@
#if ENABLE(PLUGIN_PROCESS)
+#import "PluginController.h"
#import <WebKitSystemInterface.h>
namespace WebKit {
@@ -54,6 +55,11 @@
return !m_remoteLayerClientID;
}
+void PluginProxy::setComplexTextInputState(uint64_t complexTextInputState)
+{
+ controller()->setComplexTextInputState(static_cast<PluginComplexTextInputState>(complexTextInputState));
+}
+
} // namespace WebKit
#endif // ENABLE(PLUGIN_PROCESS)
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h (93446 => 93447)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h 2011-08-19 22:50:47 UTC (rev 93447)
@@ -26,6 +26,7 @@
#ifndef PluginController_h
#define PluginController_h
+#include "PluginComplexTextInputState.h"
#include <wtf/Forward.h>
struct NPObject;
@@ -109,7 +110,7 @@
#if PLATFORM(MAC)
// Tells the controller that complex text input be enabled or disabled for the plug-in.
- virtual void setComplexTextInputEnabled(bool) = 0;
+ virtual void setComplexTextInputState(PluginComplexTextInputState) = 0;
// Returns the mach port of the compositing render server.
virtual mach_port_t compositingRenderServerPort() = 0;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp (93446 => 93447)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp 2011-08-19 22:50:47 UTC (rev 93447)
@@ -470,13 +470,6 @@
controller()->setStatusbarText(statusbarText);
}
-#if PLATFORM(MAC)
-void PluginProxy::setComplexTextInputEnabled(bool complexTextInputEnabled)
-{
- controller()->setComplexTextInputEnabled(complexTextInputEnabled);
-}
-#endif
-
void PluginProxy::update(const IntRect& paintedRect)
{
if (paintedRect == m_frameRect)
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h (93446 => 93447)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h 2011-08-19 22:50:47 UTC (rev 93447)
@@ -119,7 +119,7 @@
void cancelManualStreamLoad();
void setStatusbarText(const String& statusbarText);
#if PLATFORM(MAC)
- void setComplexTextInputEnabled(bool);
+ void setComplexTextInputState(uint64_t);
#endif
String m_pluginPath;
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.messages.in (93446 => 93447)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.messages.in 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.messages.in 2011-08-19 22:50:47 UTC (rev 93447)
@@ -58,7 +58,7 @@
#if PLATFORM(MAC)
# Change whether complext text input is enabled for this plug-in.
- SetComplexTextInputEnabled(bool complexTextInputEnabled)
+ SetComplexTextInputState(uint64_t complexTextInputState)
#endif
}
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp (93446 => 93447)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp 2011-08-19 22:50:47 UTC (rev 93447)
@@ -287,7 +287,7 @@
m_plugin->destroyPlugin();
m_isBeingDestroyed = false;
#if PLATFORM(MAC)
- setComplexTextInputEnabled(false);
+ setComplexTextInputState(PluginComplexTextInputDisabled);
#endif
}
@@ -1067,16 +1067,15 @@
#endif
#if PLATFORM(MAC)
-void PluginView::setComplexTextInputEnabled(bool complexTextInputEnabled)
+void PluginView::setComplexTextInputState(PluginComplexTextInputState pluginComplexTextInputState)
{
- m_webPage->send(Messages::WebPageProxy::SetComplexTextInputEnabled(m_plugin->pluginComplexTextInputIdentifier(), complexTextInputEnabled));
+ m_webPage->send(Messages::WebPageProxy::SetPluginComplexTextInputState(m_plugin->pluginComplexTextInputIdentifier(), pluginComplexTextInputState));
}
mach_port_t PluginView::compositingRenderServerPort()
{
return WebProcess::shared().compositingRenderServerPort();
}
-
#endif
String PluginView::proxiesForURL(const String& urlString)
Modified: trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h (93446 => 93447)
--- trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h 2011-08-19 22:38:26 UTC (rev 93446)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h 2011-08-19 22:50:47 UTC (rev 93447)
@@ -141,7 +141,7 @@
virtual void scheduleWindowedPluginGeometryUpdate(const WindowGeometry&);
#endif
#if PLATFORM(MAC)
- virtual void setComplexTextInputEnabled(bool);
+ virtual void setComplexTextInputState(PluginComplexTextInputState);
virtual mach_port_t compositingRenderServerPort();
#endif
virtual String proxiesForURL(const String&);