[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da
andersca at apple.com
andersca at apple.com
Wed Dec 22 18:32:50 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 2fbe1a8d294d64a5efc461646f04982d74fee3b5
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Dec 13 21:53:11 2010 +0000
Add the ability for plug-ins to toggle complex text input
https://bugs.webkit.org/show_bug.cgi?id=50966
Reviewed by Sam Weinig.
* PluginProcess/PluginControllerProxy.cpp:
(WebKit::PluginControllerProxy::PluginControllerProxy):
Initialize m_isComplexTextInputEnabled.
(WebKit::PluginControllerProxy::setComplexTextInputEnabled):
Update m_isComplexTextInputEnabled.
* PluginProcess/PluginControllerProxy.h:
* WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
(WebKit::NetscapePlugin::NetscapePlugin):
Initialize m_pluginHasFocus and m_windowHasFocus.
* WebProcess/Plugins/Netscape/NetscapePlugin.h:
(WebKit::NetscapePlugin::isWindowActive):
Return m_windowHasFocus.
* WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
(WebKit::NetscapePlugin::platformSetFocus):
Update m_pluginHasFocus and call setComplexTextInputEnabled.
(WebKit::NetscapePlugin::windowFocusChanged):
Update m_windowHasFocus and call setComplexTextInputEnabled.
* WebProcess/Plugins/PluginController.h:
Add setComplexTextInputEnabled.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::setComplexTextInputEnabled):
* WebProcess/Plugins/PluginView.h:
Add setComplexTextInputEnabled
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index fba8581..39ed281 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,41 @@
+2010-12-13 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Add the ability for plug-ins to toggle complex text input
+ https://bugs.webkit.org/show_bug.cgi?id=50966
+
+ * PluginProcess/PluginControllerProxy.cpp:
+ (WebKit::PluginControllerProxy::PluginControllerProxy):
+ Initialize m_isComplexTextInputEnabled.
+
+ (WebKit::PluginControllerProxy::setComplexTextInputEnabled):
+ Update m_isComplexTextInputEnabled.
+
+ * PluginProcess/PluginControllerProxy.h:
+ * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
+ (WebKit::NetscapePlugin::NetscapePlugin):
+ Initialize m_pluginHasFocus and m_windowHasFocus.
+
+ * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+ (WebKit::NetscapePlugin::isWindowActive):
+ Return m_windowHasFocus.
+
+ * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
+ (WebKit::NetscapePlugin::platformSetFocus):
+ Update m_pluginHasFocus and call setComplexTextInputEnabled.
+
+ (WebKit::NetscapePlugin::windowFocusChanged):
+ Update m_windowHasFocus and call setComplexTextInputEnabled.
+
+ * WebProcess/Plugins/PluginController.h:
+ Add setComplexTextInputEnabled.
+
+ * WebProcess/Plugins/PluginView.cpp:
+ (WebKit::PluginView::setComplexTextInputEnabled):
+ * WebProcess/Plugins/PluginView.h:
+ Add setComplexTextInputEnabled
+
2010-12-13 David Hyatt <hyatt at apple.com>
Reviewed by Adam Roben.
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.cpp b/WebKit2/PluginProcess/PluginControllerProxy.cpp
index db8ca4f..5cb67ba 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.cpp
+++ b/WebKit2/PluginProcess/PluginControllerProxy.cpp
@@ -57,6 +57,9 @@ PluginControllerProxy::PluginControllerProxy(WebProcessConnection* connection, u
, m_isPrivateBrowsingEnabled(isPrivateBrowsingEnabled)
, m_paintTimer(RunLoop::main(), this, &PluginControllerProxy::paint)
, m_waitingForDidUpdate(false)
+#if PLATFORM(MAC)
+ , m_isComplexTextInputEnabled(false)
+#endif
{
}
@@ -232,6 +235,15 @@ void PluginControllerProxy::pluginProcessCrashed()
ASSERT_NOT_REACHED();
}
+void PluginControllerProxy::setComplexTextInputEnabled(bool complexTextInputEnabled)
+{
+ if (m_isComplexTextInputEnabled == complexTextInputEnabled)
+ return;
+
+ m_isComplexTextInputEnabled = complexTextInputEnabled;
+ // FIXME: Let the web process know that this plug-in wants complex text input enabled.
+}
+
String PluginControllerProxy::proxiesForURL(const String& urlString)
{
String proxyString;
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.h b/WebKit2/PluginProcess/PluginControllerProxy.h
index 0ac1266..62f59c6 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.h
+++ b/WebKit2/PluginProcess/PluginControllerProxy.h
@@ -87,6 +87,11 @@ private:
virtual void setStatusbarText(const String&);
virtual bool isAcceleratedCompositingEnabled();
virtual void pluginProcessCrashed();
+
+#if PLATFORM(MAC)
+ virtual void setComplexTextInputEnabled(bool);
+#endif
+
virtual String proxiesForURL(const String&);
virtual String cookiesForURL(const String&);
virtual void setCookiesForURL(const String& urlString, const String& cookieString);
@@ -148,13 +153,16 @@ private:
// backing store into the web process backing store.
bool m_waitingForDidUpdate;
- // The backing store that this plug-in draws into.
- RefPtr<BackingStore> m_backingStore;
-
#if PLATFORM(MAC)
+ // Whether complex text input is enabled for this plug-in.
+ bool m_isComplexTextInputEnabled;
+
// For CA plug-ins, this holds the information needed to export the layer hierarchy to the UI process.
RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient;
#endif
+
+ // The backing store that this plug-in draws into.
+ RefPtr<BackingStore> m_backingStore;
};
} // namespace WebKit
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
index 7c2f4a0..c5fb912 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp
@@ -67,10 +67,11 @@ NetscapePlugin::NetscapePlugin(PassRefPtr<NetscapePluginModule> pluginModule)
#if PLATFORM(MAC)
, m_drawingModel(static_cast<NPDrawingModel>(-1))
, m_eventModel(static_cast<NPEventModel>(-1))
+ , m_pluginHasFocus(false)
+ , m_windowHasFocus(false)
#ifndef NP_NO_CARBON
, m_nullEventTimer(RunLoop::main(), this, &NetscapePlugin::nullEventTimerFired)
, m_npCGContext()
- , m_isWindowActive(false)
#endif
#endif
{
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
index 9789b5b..f92cec9 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
@@ -55,7 +55,7 @@ public:
NPError setEventModel(NPEventModel);
#ifndef NP_NO_CARBON
WindowRef windowRef() const;
- bool isWindowActive() const { return m_isWindowActive; }
+ bool isWindowActive() const { return m_windowHasFocus; }
static NetscapePlugin* netscapePluginFromWindow(WindowRef);
static unsigned buttonState();
@@ -195,6 +195,10 @@ private:
NPDrawingModel m_drawingModel;
NPEventModel m_eventModel;
RetainPtr<PlatformLayer> m_pluginLayer;
+
+ bool m_pluginHasFocus;
+ bool m_windowHasFocus;
+
#ifndef NP_NO_CARBON
void nullEventTimerFired();
@@ -202,7 +206,6 @@ private:
// We should investigate having one per window.
RunLoop::Timer<NetscapePlugin> m_nullEventTimer;
NP_CGContext m_npCGContext;
- bool m_isWindowActive;
#endif
#elif PLATFORM(WIN)
HWND m_window;
diff --git a/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm b/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
index 41464eb..c619e74 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
+++ b/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
@@ -25,6 +25,7 @@
#include "NetscapePlugin.h"
+#include "PluginController.h"
#include "WebEvent.h"
#include <WebCore/GraphicsContext.h>
@@ -602,6 +603,9 @@ bool NetscapePlugin::platformHandleKeyboardEvent(const WebKeyboardEvent& keyboar
void NetscapePlugin::platformSetFocus(bool hasFocus)
{
+ m_pluginHasFocus = hasFocus;
+ m_pluginController->setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
+
switch (m_eventModel) {
case NPEventModelCocoa: {
NPCocoaEvent event = initializeEvent(NPCocoaEventFocusChanged);
@@ -627,6 +631,9 @@ void NetscapePlugin::platformSetFocus(bool hasFocus)
void NetscapePlugin::windowFocusChanged(bool hasFocus)
{
+ m_windowHasFocus = hasFocus;
+ m_pluginController->setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
+
switch (m_eventModel) {
case NPEventModelCocoa: {
NPCocoaEvent event = initializeEvent(NPCocoaEventWindowFocusChanged);
@@ -638,8 +645,6 @@ void NetscapePlugin::windowFocusChanged(bool hasFocus)
#ifndef NP_NO_CARBON
case NPEventModelCarbon: {
- m_isWindowActive = hasFocus;
-
HiliteWindow(windowRef(), hasFocus);
if (hasFocus)
SetUserFocusWindow(windowRef());
diff --git a/WebKit2/WebProcess/Plugins/PluginController.h b/WebKit2/WebProcess/Plugins/PluginController.h
index b87c400..06cf2d7 100644
--- a/WebKit2/WebProcess/Plugins/PluginController.h
+++ b/WebKit2/WebProcess/Plugins/PluginController.h
@@ -88,6 +88,11 @@ public:
virtual HWND nativeParentWindow() = 0;
#endif
+#if PLATFORM(MAC)
+ // Tells the controller that complex text input be enabled or disabled for the plug-in.
+ virtual void setComplexTextInputEnabled(bool) = 0;
+#endif
+
// Returns the proxies for the given URL or null on failure.
virtual String proxiesForURL(const String&) = 0;
diff --git a/WebKit2/WebProcess/Plugins/PluginView.cpp b/WebKit2/WebProcess/Plugins/PluginView.cpp
index f6e4925..86c3d2c 100644
--- a/WebKit2/WebProcess/Plugins/PluginView.cpp
+++ b/WebKit2/WebProcess/Plugins/PluginView.cpp
@@ -869,6 +869,14 @@ HWND PluginView::nativeParentWindow()
}
#endif
+#if PLATFORM(MAC)
+void PluginView::setComplexTextInputEnabled(bool)
+{
+ // This should never be called.
+ ASSERT_NOT_REACHED();
+}
+#endif
+
String PluginView::proxiesForURL(const String& urlString)
{
const FrameLoader* frameLoader = frame() ? frame()->loader() : 0;
diff --git a/WebKit2/WebProcess/Plugins/PluginView.h b/WebKit2/WebProcess/Plugins/PluginView.h
index 9d64859..8929dbc 100644
--- a/WebKit2/WebProcess/Plugins/PluginView.h
+++ b/WebKit2/WebProcess/Plugins/PluginView.h
@@ -125,6 +125,9 @@ private:
#if PLATFORM(WIN)
virtual HWND nativeParentWindow();
#endif
+#if PLATFORM(MAC)
+ virtual void setComplexTextInputEnabled(bool);
+#endif
virtual String proxiesForURL(const String&);
virtual String cookiesForURL(const String&);
virtual void setCookiesForURL(const String& urlString, const String& cookieString);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list