Changeset 73956 in webkit


Ignore:
Timestamp:
Dec 13, 2010 1:53:11 PM (13 years ago)
Author:
andersca@apple.com
Message:

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

Location:
trunk/WebKit2
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit2/ChangeLog

    r73952 r73956  
     12010-12-13  Anders Carlsson  <andersca@apple.com>
     2
     3        Reviewed by Sam Weinig.
     4
     5        Add the ability for plug-ins to toggle complex text input
     6        https://bugs.webkit.org/show_bug.cgi?id=50966
     7
     8        * PluginProcess/PluginControllerProxy.cpp:
     9        (WebKit::PluginControllerProxy::PluginControllerProxy):
     10        Initialize m_isComplexTextInputEnabled.
     11
     12        (WebKit::PluginControllerProxy::setComplexTextInputEnabled):
     13        Update m_isComplexTextInputEnabled.
     14
     15        * PluginProcess/PluginControllerProxy.h:
     16        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
     17        (WebKit::NetscapePlugin::NetscapePlugin):
     18        Initialize m_pluginHasFocus and m_windowHasFocus.
     19
     20        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
     21        (WebKit::NetscapePlugin::isWindowActive):
     22        Return m_windowHasFocus.
     23
     24        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
     25        (WebKit::NetscapePlugin::platformSetFocus):
     26        Update m_pluginHasFocus and call setComplexTextInputEnabled.
     27
     28        (WebKit::NetscapePlugin::windowFocusChanged):
     29        Update m_windowHasFocus and call setComplexTextInputEnabled.
     30
     31        * WebProcess/Plugins/PluginController.h:
     32        Add setComplexTextInputEnabled.
     33
     34        * WebProcess/Plugins/PluginView.cpp:
     35        (WebKit::PluginView::setComplexTextInputEnabled):
     36        * WebProcess/Plugins/PluginView.h:
     37        Add setComplexTextInputEnabled
     38
    1392010-12-13  David Hyatt  <hyatt@apple.com>
    240
  • trunk/WebKit2/PluginProcess/PluginControllerProxy.cpp

    r73419 r73956  
    5858    , m_paintTimer(RunLoop::main(), this, &PluginControllerProxy::paint)
    5959    , m_waitingForDidUpdate(false)
     60#if PLATFORM(MAC)
     61    , m_isComplexTextInputEnabled(false)
     62#endif
    6063{
    6164}
     
    233236}
    234237
     238void PluginControllerProxy::setComplexTextInputEnabled(bool complexTextInputEnabled)
     239{
     240    if (m_isComplexTextInputEnabled == complexTextInputEnabled)
     241        return;
     242
     243    m_isComplexTextInputEnabled = complexTextInputEnabled;
     244    // FIXME: Let the web process know that this plug-in wants complex text input enabled.
     245}
     246
    235247String PluginControllerProxy::proxiesForURL(const String& urlString)
    236248{
  • trunk/WebKit2/PluginProcess/PluginControllerProxy.h

    r73090 r73956  
    8888    virtual bool isAcceleratedCompositingEnabled();
    8989    virtual void pluginProcessCrashed();
     90
     91#if PLATFORM(MAC)
     92    virtual void setComplexTextInputEnabled(bool);
     93#endif
     94
    9095    virtual String proxiesForURL(const String&);
    9196    virtual String cookiesForURL(const String&);
     
    149154    bool m_waitingForDidUpdate;
    150155
    151     // The backing store that this plug-in draws into.
    152     RefPtr<BackingStore> m_backingStore;
     156#if PLATFORM(MAC)
     157    // Whether complex text input is enabled for this plug-in.
     158    bool m_isComplexTextInputEnabled;
    153159
    154 #if PLATFORM(MAC)
    155160    // For CA plug-ins, this holds the information needed to export the layer hierarchy to the UI process.
    156161    RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient;
    157162#endif
     163   
     164    // The backing store that this plug-in draws into.
     165    RefPtr<BackingStore> m_backingStore;
    158166};
    159167
  • trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp

    r73419 r73956  
    6868    , m_drawingModel(static_cast<NPDrawingModel>(-1))
    6969    , m_eventModel(static_cast<NPEventModel>(-1))
     70    , m_pluginHasFocus(false)
     71    , m_windowHasFocus(false)
    7072#ifndef NP_NO_CARBON
    7173    , m_nullEventTimer(RunLoop::main(), this, &NetscapePlugin::nullEventTimerFired)
    7274    , m_npCGContext()
    73     , m_isWindowActive(false)
    7475#endif   
    7576#endif
  • trunk/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h

    r73419 r73956  
    5656#ifndef NP_NO_CARBON
    5757    WindowRef windowRef() const;
    58     bool isWindowActive() const { return m_isWindowActive; }
     58    bool isWindowActive() const { return m_windowHasFocus; }
    5959
    6060    static NetscapePlugin* netscapePluginFromWindow(WindowRef);
     
    196196    NPEventModel m_eventModel;
    197197    RetainPtr<PlatformLayer> m_pluginLayer;
     198
     199    bool m_pluginHasFocus;
     200    bool m_windowHasFocus;
     201
    198202#ifndef NP_NO_CARBON
    199203    void nullEventTimerFired();
     
    203207    RunLoop::Timer<NetscapePlugin> m_nullEventTimer;
    204208    NP_CGContext m_npCGContext;
    205     bool m_isWindowActive;
    206209#endif
    207210#elif PLATFORM(WIN)
  • trunk/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm

    r73393 r73956  
    2626#include "NetscapePlugin.h"
    2727
     28#include "PluginController.h"
    2829#include "WebEvent.h"
    2930#include <WebCore/GraphicsContext.h>
     
    603604void NetscapePlugin::platformSetFocus(bool hasFocus)
    604605{
     606    m_pluginHasFocus = hasFocus;
     607    m_pluginController->setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
     608
    605609    switch (m_eventModel) {
    606610        case NPEventModelCocoa: {
     
    628632void NetscapePlugin::windowFocusChanged(bool hasFocus)
    629633{
     634    m_windowHasFocus = hasFocus;
     635    m_pluginController->setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
     636
    630637    switch (m_eventModel) {
    631638        case NPEventModelCocoa: {
     
    639646#ifndef NP_NO_CARBON
    640647        case NPEventModelCarbon: {
    641             m_isWindowActive = hasFocus;
    642            
    643648            HiliteWindow(windowRef(), hasFocus);
    644649            if (hasFocus)
  • trunk/WebKit2/WebProcess/Plugins/PluginController.h

    r68962 r73956  
    8989#endif
    9090
     91#if PLATFORM(MAC)
     92    // Tells the controller that complex text input be enabled or disabled for the plug-in.
     93    virtual void setComplexTextInputEnabled(bool) = 0;
     94#endif
     95
    9196    // Returns the proxies for the given URL or null on failure.
    9297    virtual String proxiesForURL(const String&) = 0;
  • trunk/WebKit2/WebProcess/Plugins/PluginView.cpp

    r73444 r73956  
    870870#endif
    871871
     872#if PLATFORM(MAC)
     873void PluginView::setComplexTextInputEnabled(bool)
     874{
     875    // This should never be called.
     876    ASSERT_NOT_REACHED();
     877}
     878#endif
     879   
    872880String PluginView::proxiesForURL(const String& urlString)
    873881{
  • trunk/WebKit2/WebProcess/Plugins/PluginView.h

    r73090 r73956  
    126126    virtual HWND nativeParentWindow();
    127127#endif
     128#if PLATFORM(MAC)
     129    virtual void setComplexTextInputEnabled(bool);
     130#endif
    128131    virtual String proxiesForURL(const String&);
    129132    virtual String cookiesForURL(const String&);
Note: See TracChangeset for help on using the changeset viewer.