Changeset 93447 in webkit


Ignore:
Timestamp:
Aug 19, 2011 3:50:47 PM (13 years ago)
Author:
andersca@apple.com
Message:

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:
Location:
trunk/Source/WebKit2
Files:
2 added
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r93427 r93447  
     12011-08-19  Anders Carlsson  <andersca@apple.com>
     2
     3        Make the complex text input state a tri-state enum instead of a boolean
     4        https://bugs.webkit.org/show_bug.cgi?id=62245
     5
     6        Reviewed by Sam Weinig.
     7
     8        This is to prepare the infrastructure for supporting the updated Cocoa text input model for plug-ins.
     9
     10        * PluginProcess/PluginControllerProxy.cpp:
     11        * PluginProcess/PluginControllerProxy.h:
     12        * PluginProcess/mac/PluginControllerProxyMac.mm:
     13        (WebKit::PluginControllerProxy::setComplexTextInputState):
     14        (WebKit::PluginControllerProxy::compositingRenderServerPort):
     15        * Shared/Plugins/mac: Added.
     16        * Shared/Plugins/mac/PluginComplexTextInputState.h: Added.
     17        (WebKit::isValidPluginComplexTextInputState):
     18        * UIProcess/API/mac/PageClientImpl.h:
     19        * UIProcess/API/mac/PageClientImpl.mm:
     20        (WebKit::PageClientImpl::setPluginComplexTextInputState):
     21        * UIProcess/API/mac/WKView.mm:
     22        (-[WKView _setPluginComplexTextInputState:WebKit::pluginComplexTextInputIdentifier:]):
     23        * UIProcess/API/mac/WKViewInternal.h:
     24        * UIProcess/PageClient.h:
     25        * UIProcess/WebPageProxy.h:
     26        * UIProcess/WebPageProxy.messages.in:
     27        * UIProcess/mac/WebPageProxyMac.mm:
     28        (WebKit::WebPageProxy::setPluginComplexTextInputState):
     29        * WebKit2.xcodeproj/project.pbxproj:
     30        * WebProcess/Plugins/Netscape/NetscapePlugin.cpp:
     31        (WebKit::NetscapePlugin::NetscapePlugin):
     32        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
     33        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
     34        (WebKit::NetscapePlugin::platformSetFocus):
     35        (WebKit::NetscapePlugin::windowFocusChanged):
     36        (WebKit::NetscapePlugin::setComplexTextInputEnabled):
     37        * WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm:
     38        (WebKit::PluginProxy::setComplexTextInputState):
     39        * WebProcess/Plugins/PluginController.h:
     40        * WebProcess/Plugins/PluginProxy.cpp:
     41        * WebProcess/Plugins/PluginProxy.h:
     42        * WebProcess/Plugins/PluginProxy.messages.in:
     43        * WebProcess/Plugins/PluginView.cpp:
     44        (WebKit::PluginView::~PluginView):
     45        (WebKit::PluginView::setComplexTextInputState):
     46        (WebKit::PluginView::compositingRenderServerPort):
     47        * WebProcess/Plugins/PluginView.h:
     48
    1492011-08-19  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
    250
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.cpp

    r90764 r93447  
    362362}
    363363
    364 #if PLATFORM(MAC)
    365 void PluginControllerProxy::setComplexTextInputEnabled(bool complexTextInputEnabled)
    366 {
    367     if (m_isComplexTextInputEnabled == complexTextInputEnabled)
    368         return;
    369 
    370     m_isComplexTextInputEnabled = complexTextInputEnabled;
    371 
    372     m_connection->connection()->send(Messages::PluginProxy::SetComplexTextInputEnabled(complexTextInputEnabled), m_pluginInstanceID);
    373 }
    374 
    375 mach_port_t PluginControllerProxy::compositingRenderServerPort()
    376 {
    377     return PluginProcess::shared().compositingRenderServerPort();
    378 }
    379 #endif
    380 
    381364String PluginControllerProxy::proxiesForURL(const String& urlString)
    382365{
  • trunk/Source/WebKit2/PluginProcess/PluginControllerProxy.h

    r90764 r93447  
    9797
    9898#if PLATFORM(MAC)
    99     virtual void setComplexTextInputEnabled(bool);
     99    virtual void setComplexTextInputState(PluginComplexTextInputState);
    100100    virtual mach_port_t compositingRenderServerPort();
    101101#endif
  • trunk/Source/WebKit2/PluginProcess/mac/PluginControllerProxyMac.mm

    r83624 r93447  
    2929#if ENABLE(PLUGIN_PROCESS)
    3030
     31#import "PluginProcess.h"
     32#import "PluginProxyMessages.h"
     33#import "WebKitSystemInterface.h"
     34#import "WebProcessConnection.h"
    3135#import <QuartzCore/QuartzCore.h>
    32 #import "PluginProcess.h"
    33 #import "WebKitSystemInterface.h"
    3436
    3537using namespace WebCore;
    3638
    3739namespace WebKit {
     40
     41void PluginControllerProxy::setComplexTextInputState(PluginComplexTextInputState pluginComplexTextInputState)
     42{
     43    m_connection->connection()->send(Messages::PluginProxy::SetComplexTextInputState(pluginComplexTextInputState), m_pluginInstanceID);
     44}
     45
     46mach_port_t PluginControllerProxy::compositingRenderServerPort()
     47{
     48    return PluginProcess::shared().compositingRenderServerPort();
     49}
    3850
    3951void PluginControllerProxy::platformInitialize()
  • trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.h

    r93314 r93447  
    9595
    9696    virtual void accessibilityWebProcessTokenReceived(const CoreIPC::DataReference&);   
    97     virtual void setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled);
     97    virtual void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState);
    9898
    9999    virtual void makeFirstResponder();
  • trunk/Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm

    r93314 r93447  
    343343#endif // USE(ACCELERATED_COMPOSITING)
    344344
    345 void PageClientImpl::setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled)
    346 {
    347     [m_wkView _setComplexTextInputEnabled:complexTextInputEnabled pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier];
     345void PageClientImpl::setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState pluginComplexTextInputState)
     346{
     347    [m_wkView _setPluginComplexTextInputState:pluginComplexTextInputState pluginComplexTextInputIdentifier:pluginComplexTextInputIdentifier];
    348348}
    349349
  • trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm

    r93337 r93447  
    22862286}
    22872287
    2288 - (void)_setComplexTextInputEnabled:(BOOL)complexTextInputEnabled pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier
     2288- (void)_setPluginComplexTextInputState:(WebKit::PluginComplexTextInputState)pluginComplexTextInputState pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier
    22892289{
    22902290    BOOL inputSourceChanged = _data->_pluginComplexTextInputIdentifier;
     2291    BOOL complexTextInputEnabled = (pluginComplexTextInputState == PluginComplexTextInputEnabledLegacy);
    22912292
    22922293    if (complexTextInputEnabled) {
  • trunk/Source/WebKit2/UIProcess/API/mac/WKViewInternal.h

    r93337 r93447  
    2424 */
    2525
     26#import "PluginComplexTextInputState.h"
    2627#import "WKView.h"
    2728#import "WebFindOptions.h"
     
    6667
    6768- (void)_setAccessibilityWebProcessToken:(NSData *)data;
    68 - (void)_setComplexTextInputEnabled:(BOOL)complexTextInputEnabled pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier;
     69- (void)_setPluginComplexTextInputState:(WebKit::PluginComplexTextInputState)pluginComplexTextInputState pluginComplexTextInputIdentifier:(uint64_t)pluginComplexTextInputIdentifier;
    6970
    7071- (void)_setPageHasCustomRepresentation:(BOOL)pageHasCustomRepresentation;
  • trunk/Source/WebKit2/UIProcess/PageClient.h

    r93314 r93447  
    2727#define PageClient_h
    2828
     29#include "PluginComplexTextInputState.h"
    2930#include "ShareableBitmap.h"
    3031#include "WebPageProxy.h"
     
    163164
    164165#if PLATFORM(MAC)
    165     virtual void setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled) = 0;
     166    virtual void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, PluginComplexTextInputState) = 0;
    166167    virtual CGContextRef containingWindowGraphicsContext() = 0;
    167168    virtual void didPerformDictionaryLookup(const String&, double scaleFactor, const DictionaryPopupInfo&) = 0;
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r93314 r93447  
    767767
    768768#if PLATFORM(MAC)
    769     void setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled);
     769    void setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState);
    770770#endif
    771771
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in

    r93040 r93447  
    230230
    231231    # Plug-in complex text input support messages
    232     SetComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled)
     232    SetPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t complexTextInputState)
    233233
    234234    # Speech messages
  • trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm

    r93040 r93447  
    3232#import "EditorState.h"
    3333#import "NativeWebKeyboardEvent.h"
     34#import "PluginComplexTextInputState.h"
    3435#import "PageClient.h"
    3536#import "PageClientImpl.h"
     
    4243- (void)speakString:(NSString *)string;
    4344@end
     45
     46#define MESSAGE_CHECK(assertion) MESSAGE_CHECK_BASE(assertion, process()->connection())
    4447
    4548using namespace WebCore;
     
    340343}
    341344
    342 void WebPageProxy::setComplexTextInputEnabled(uint64_t pluginComplexTextInputIdentifier, bool complexTextInputEnabled)
    343 {
    344     m_pageClient->setComplexTextInputEnabled(pluginComplexTextInputIdentifier, complexTextInputEnabled);
     345void WebPageProxy::setPluginComplexTextInputState(uint64_t pluginComplexTextInputIdentifier, uint64_t pluginComplexTextInputState)
     346{
     347    MESSAGE_CHECK(isValidPluginComplexTextInputState(pluginComplexTextInputState));
     348
     349    m_pageClient->setPluginComplexTextInputState(pluginComplexTextInputIdentifier, static_cast<PluginComplexTextInputState>(pluginComplexTextInputState));
    345350}
    346351
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r93233 r93447  
    175175                1A92DC1112F8BA460017AF65 /* LayerTreeContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */; };
    176176                1A92DC1312F8BAB90017AF65 /* LayerTreeContextMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A92DC1212F8BAB90017AF65 /* LayerTreeContextMac.mm */; };
     177                1A9FBA8D13FF04E600DEED67 /* PluginComplexTextInputState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A9FBA8C13FF04E600DEED67 /* PluginComplexTextInputState.h */; };
    177178                1AA1CC5D100FA1A10078DEBC /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */; };
    178179                1AA1CD07100FA1BA0078DEBC /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CD06100FA1BA0078DEBC /* Carbon.framework */; };
     
    10871088                1A92DC1012F8BA460017AF65 /* LayerTreeContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerTreeContext.h; sourceTree = "<group>"; };
    10881089                1A92DC1212F8BAB90017AF65 /* LayerTreeContextMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = LayerTreeContextMac.mm; sourceTree = "<group>"; };
     1090                1A9FBA8C13FF04E600DEED67 /* PluginComplexTextInputState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginComplexTextInputState.h; sourceTree = "<group>"; };
    10891091                1AA1C79A100E7FC50078DEBC /* WebCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
    10901092                1AA1C7DE100E846E0078DEBC /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
     
    21082110                        sourceTree = "<group>";
    21092111                };
     2112                1A9FBA8B13FF04E600DEED67 /* mac */ = {
     2113                        isa = PBXGroup;
     2114                        children = (
     2115                                1A9FBA8C13FF04E600DEED67 /* PluginComplexTextInputState.h */,
     2116                        );
     2117                        path = mac;
     2118                        sourceTree = "<group>";
     2119                };
    21102120                1AA2E51A12E4C05600BC4966 /* cg */ = {
    21112121                        isa = PBXGroup;
     
    22422252                        isa = PBXGroup;
    22432253                        children = (
     2254                                1A9FBA8B13FF04E600DEED67 /* mac */,
    22442255                                1A4A9C5212B816CF008FE984 /* Netscape */,
    22452256                                1A3D60FF13A7CC2A00F95D4E /* PluginModuleInfo.cpp */,
     
    38113822                                1A3D610213A7CC2A00F95D4E /* PluginModuleInfo.h in Headers */,
    38123823                                5D51845613BCF9CC00C7FF4A /* APIClientTraits.h in Headers */,
     3824                                1A9FBA8D13FF04E600DEED67 /* PluginComplexTextInputState.h in Headers */,
    38133825                        );
    38143826                        runOnlyForDeploymentPostprocessing = 0;
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.cpp

    r91793 r93447  
    7676    , m_pluginHasFocus(false)
    7777    , m_windowHasFocus(false)
     78    , m_isComplexTextInputEnabled(false)
    7879#ifndef NP_NO_CARBON
    7980    , m_nullEventTimer(RunLoop::main(), this, &NetscapePlugin::nullEventTimerFired)
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h

    r90764 r93447  
    191191    virtual uint64_t pluginComplexTextInputIdentifier() const;
    192192    virtual void sendComplexTextInput(const String& textInput);
     193
     194    void setComplexTextInputEnabled(bool);
    193195#endif
    194196
     
    240242    bool m_windowHasFocus;
    241243
     244    // Whether complex text input is enabled.
     245    bool m_isComplexTextInputEnabled;
     246
    242247    WebCore::IntRect m_windowFrameInScreenCoordinates;
    243248    WebCore::IntRect m_viewFrameInWindowCoordinates;
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm

    r90326 r93447  
    788788{
    789789    m_pluginHasFocus = hasFocus;
    790     controller()->setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
     790    setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
    791791
    792792    switch (m_eventModel) {
     
    816816{
    817817    m_windowHasFocus = hasFocus;
    818     controller()->setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
     818    setComplexTextInputEnabled(m_pluginHasFocus && m_windowHasFocus);
    819819
    820820    switch (m_eventModel) {
     
    976976}
    977977
     978void NetscapePlugin::setComplexTextInputEnabled(bool complexTextInputEnabled)
     979{
     980    if (m_isComplexTextInputEnabled == complexTextInputEnabled)
     981        return;
     982
     983    m_isComplexTextInputEnabled = complexTextInputEnabled;
     984    controller()->setComplexTextInputState(complexTextInputEnabled ? PluginComplexTextInputEnabledLegacy : PluginComplexTextInputDisabled);
     985}
     986
    978987PlatformLayer* NetscapePlugin::pluginLayer()
    979988{
  • trunk/Source/WebKit2/WebProcess/Plugins/Netscape/mac/PluginProxyMac.mm

    r82997 r93447  
    2929#if ENABLE(PLUGIN_PROCESS)
    3030
     31#import "PluginController.h"
    3132#import <WebKitSystemInterface.h>
    3233
     
    5556}
    5657
     58void PluginProxy::setComplexTextInputState(uint64_t complexTextInputState)
     59{
     60    controller()->setComplexTextInputState(static_cast<PluginComplexTextInputState>(complexTextInputState));
     61}
     62
    5763} // namespace WebKit
    5864
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginController.h

    r86577 r93447  
    2727#define PluginController_h
    2828
     29#include "PluginComplexTextInputState.h"
    2930#include <wtf/Forward.h>
    3031
     
    110111#if PLATFORM(MAC)
    111112    // Tells the controller that complex text input be enabled or disabled for the plug-in.
    112     virtual void setComplexTextInputEnabled(bool) = 0;
     113    virtual void setComplexTextInputState(PluginComplexTextInputState) = 0;
    113114
    114115    // Returns the mach port of the compositing render server.
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.cpp

    r90764 r93447  
    471471}
    472472
    473 #if PLATFORM(MAC)
    474 void PluginProxy::setComplexTextInputEnabled(bool complexTextInputEnabled)
    475 {
    476     controller()->setComplexTextInputEnabled(complexTextInputEnabled);
    477 }
    478 #endif
    479    
    480473void PluginProxy::update(const IntRect& paintedRect)
    481474{
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.h

    r90764 r93447  
    120120    void setStatusbarText(const String& statusbarText);
    121121#if PLATFORM(MAC)
    122     void setComplexTextInputEnabled(bool);
     122    void setComplexTextInputState(uint64_t);
    123123#endif
    124124
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginProxy.messages.in

    r86522 r93447  
    5959#if PLATFORM(MAC)
    6060    # Change whether complext text input is enabled for this plug-in.
    61     SetComplexTextInputEnabled(bool complexTextInputEnabled)
     61    SetComplexTextInputState(uint64_t complexTextInputState)
    6262#endif
    6363}
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.cpp

    r92491 r93447  
    288288        m_isBeingDestroyed = false;
    289289#if PLATFORM(MAC)
    290         setComplexTextInputEnabled(false);
     290        setComplexTextInputState(PluginComplexTextInputDisabled);
    291291#endif
    292292    }
     
    10681068
    10691069#if PLATFORM(MAC)
    1070 void PluginView::setComplexTextInputEnabled(bool complexTextInputEnabled)
    1071 {
    1072     m_webPage->send(Messages::WebPageProxy::SetComplexTextInputEnabled(m_plugin->pluginComplexTextInputIdentifier(), complexTextInputEnabled));
     1070void PluginView::setComplexTextInputState(PluginComplexTextInputState pluginComplexTextInputState)
     1071{
     1072    m_webPage->send(Messages::WebPageProxy::SetPluginComplexTextInputState(m_plugin->pluginComplexTextInputIdentifier(), pluginComplexTextInputState));
    10731073}
    10741074
     
    10771077    return WebProcess::shared().compositingRenderServerPort();
    10781078}
    1079 
    10801079#endif
    10811080   
  • trunk/Source/WebKit2/WebProcess/Plugins/PluginView.h

    r90764 r93447  
    142142#endif
    143143#if PLATFORM(MAC)
    144     virtual void setComplexTextInputEnabled(bool);
     144    virtual void setComplexTextInputState(PluginComplexTextInputState);
    145145    virtual mach_port_t compositingRenderServerPort();
    146146#endif
Note: See TracChangeset for help on using the changeset viewer.