Changeset 122810 in webkit


Ignore:
Timestamp:
Jul 16, 2012 11:27:50 PM (12 years ago)
Author:
gyuyoung.kim@samsung.com
Message:

Add RegisterProtocolHandlerClient to the Modules/protocolhandler
https://bugs.webkit.org/show_bug.cgi?id=90940

Reviewed by Hajime Morita.

Source/WebCore:

As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs
to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for
protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient.

In addition, NavigatorRegisterProtocolHandler should be supplementable.

No new tests. Covered by existing tests.

  • GNUmakefile.list.am:
  • Modules/protocolhandler/NavigatorRegisterProtocolHandler.cpp:

(WebCore::NavigatorRegisterProtocolHandler::from):
(WebCore::NavigatorRegisterProtocolHandler::create):
(WebCore):
(WebCore::NavigatorRegisterProtocolHandler::registerProtocolHandler):
(WebCore::customHandlersStateString):
(WebCore::NavigatorRegisterProtocolHandler::isProtocolHandlerRegistered):
(WebCore::NavigatorRegisterProtocolHandler::unregisterProtocolHandler):
(WebCore::NavigatorRegisterProtocolHandler::supplementName):
(WebCore::provideRegisterProtocolHandlerTo):

  • Modules/protocolhandler/NavigatorRegisterProtocolHandler.h:

(WebCore):
(NavigatorRegisterProtocolHandler):
(WebCore::NavigatorRegisterProtocolHandler::NavigatorRegisterProtocolHandler):
(WebCore::NavigatorRegisterProtocolHandler::client):

  • Modules/protocolhandler/RegisterProtocolHandlerClient.h: Added.

(WebCore):
(RegisterProtocolHandlerClient):

  • WebCore.gypi:
  • loader/EmptyClients.h:
  • page/ChromeClient.h:

(ChromeClient):

  • platform/network/soup/CookieJarSoup.cpp:

(WebCore::setCookies):
(WebCore::getRawCookies):

Source/WebKit:

As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs
to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for
protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient.

  • PlatformEfl.cmake: Add RegisterProtocolHandlerEfl files and include path.

Source/WebKit/chromium:

As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs
to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for
protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient.

In order to support this, RegisterProtocolHandlerClientImpl class is added to ChromeClientImpl files.

In addition, existing functions related to protocol handler in ChromeClientImpl class are moved to
RegisterProtocolHandlerClientImpl class.

  • WebKit.gyp:
  • src/ChromeClientImpl.cpp: Implement RegisterProtocolHandlerClientImpl class.

(WebKit):
(WebKit::RegisterProtocolHandlerClientImpl::create):
(WebKit::RegisterProtocolHandlerClientImpl::RegisterProtocolHandlerClientImpl):
(WebKit::RegisterProtocolHandlerClientImpl::registerProtocolHandler):

  • src/ChromeClientImpl.h:

(ChromeClientImpl):
(RegisterProtocolHandlerClientImpl):
(WebKit::RegisterProtocolHandlerClientImpl::~RegisterProtocolHandlerClientImpl):
(WebKit):

  • src/WebViewImpl.cpp: Register RegisterProtocolHandlerClientImpl in order to support supplement.

(WebKit::WebViewImpl::WebViewImpl):

  • src/WebViewImpl.h:

Source/WebKit/efl:

As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs
to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for
protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient

In order to support this, RegisterProtocolHandlerClientEfl class is added and ewk_view registers
RegisterProtocolHandlerClientEfl. In addition, existing concrete functions in ChromeClientEfl are moved
to RegisterProtocolHandlerClientEfl.

  • WebCoreSupport/ChromeClientEfl.cpp:

(WebCore):

  • WebCoreSupport/ChromeClientEfl.h:
  • WebCoreSupport/RegisterProtocolHandlerClientEfl.cpp: Added.

(WebCore):
(WebCore::customHandlerDataCreate):
(WebCore::customHandlerDataDelete):
(WebCore::RegisterProtocolHandlerClientEfl::RegisterProtocolHandlerClientEfl):
(WebCore::RegisterProtocolHandlerClientEfl::registerProtocolHandler):
(WebCore::RegisterProtocolHandlerClientEfl::isProtocolHandlerRegistered):
(WebCore::RegisterProtocolHandlerClientEfl::unregisterProtocolHandler):

  • WebCoreSupport/RegisterProtocolHandlerClientEfl.h: Added.

(RegisterProtocolHandlerClientEfl):
(WebCore::RegisterProtocolHandlerClientEfl::~RegisterProtocolHandlerClientEfl):

  • ewk/ewk_view.cpp:

(_ewk_view_priv_new):

Source/WebKit/gtk:

As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs
to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for
protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient.

In order to support this, RegisterProtocolHandlerClientGtk class is added and webview registers
RegisterProtocolHandlerClientGtk. In addition, existing concrete functions in ChromeClientGtk are moved
to RegisterProtocolHandlerClientGtk.

  • GNUmakefile.am:
  • WebCoreSupport/ChromeClientGtk.cpp:
  • WebCoreSupport/ChromeClientGtk.h:

(ChromeClient):

  • WebCoreSupport/RegisterProtocolHandlerClientGtk.cpp: Added.

(WebKit):
(WebKit::RegisterProtocolHandlerClient::RegisterProtocolHandlerClient):
(WebKit::RegisterProtocolHandlerClient::registerProtocolHandler):

  • WebCoreSupport/RegisterProtocolHandlerClientGtk.h: Added.

(WebKit):
(RegisterProtocolHandlerClient):
(WebKit::RegisterProtocolHandlerClient::~RegisterProtocolHandlerClient):

  • webkit/webkitwebview.cpp:

(webkit_web_view_init):

Source/WebKit2:

As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs
to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for
protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient.

In order to support this, WebRegisterProtocolHandlerClient class is added. However, this is not implemented yet.
In addition, existing virtual functions in WebChromeClient are moved to WebRegisterProtocolHandlerClient.

  • WebProcess/WebCoreSupport/WebChromeClient.h:
  • WebProcess/WebCoreSupport/WebRegisterProtocolHandlerClient.h: Added.

(WebKit):
(WebRegisterProtoclHandlerClient):
(WebKit::WebRegisterProtoclHandlerClient::isProtocolHandlerRegistered):
(WebKit::WebRegisterProtoclHandlerClient::unregisterProtocolHandler):

Location:
trunk/Source
Files:
6 added
25 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r122806 r122810  
     12012-07-16  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Add RegisterProtocolHandlerClient to the Modules/protocolhandler
     4        https://bugs.webkit.org/show_bug.cgi?id=90940
     5
     6        Reviewed by Hajime Morita.
     7
     8        As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs
     9        to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for
     10        protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient.
     11
     12        In addition, NavigatorRegisterProtocolHandler should be supplementable.
     13
     14        No new tests. Covered by existing tests.
     15
     16        * GNUmakefile.list.am:
     17        * Modules/protocolhandler/NavigatorRegisterProtocolHandler.cpp:
     18        (WebCore::NavigatorRegisterProtocolHandler::from):
     19        (WebCore::NavigatorRegisterProtocolHandler::create):
     20        (WebCore):
     21        (WebCore::NavigatorRegisterProtocolHandler::registerProtocolHandler):
     22        (WebCore::customHandlersStateString):
     23        (WebCore::NavigatorRegisterProtocolHandler::isProtocolHandlerRegistered):
     24        (WebCore::NavigatorRegisterProtocolHandler::unregisterProtocolHandler):
     25        (WebCore::NavigatorRegisterProtocolHandler::supplementName):
     26        (WebCore::provideRegisterProtocolHandlerTo):
     27        * Modules/protocolhandler/NavigatorRegisterProtocolHandler.h:
     28        (WebCore):
     29        (NavigatorRegisterProtocolHandler):
     30        (WebCore::NavigatorRegisterProtocolHandler::NavigatorRegisterProtocolHandler):
     31        (WebCore::NavigatorRegisterProtocolHandler::client):
     32        * Modules/protocolhandler/RegisterProtocolHandlerClient.h: Added.
     33        (WebCore):
     34        (RegisterProtocolHandlerClient):
     35        * WebCore.gypi:
     36        * loader/EmptyClients.h:
     37        * page/ChromeClient.h:
     38        (ChromeClient):
     39        * platform/network/soup/CookieJarSoup.cpp:
     40        (WebCore::setCookies):
     41        (WebCore::getRawCookies):
     42
    1432012-07-16  Pete Williamson  <petewil@google.com>
    244
  • trunk/Source/WebCore/GNUmakefile.list.am

    r122773 r122810  
    12101210        Source/WebCore/Modules/protocolhandler/NavigatorRegisterProtocolHandler.cpp \
    12111211        Source/WebCore/Modules/protocolhandler/NavigatorRegisterProtocolHandler.h \
     1212        Source/WebCore/Modules/protocolhandler/RegisterProtocolHandlerClient.h \
    12121213        Source/WebCore/Modules/webdatabase/AbstractDatabase.cpp \
    12131214        Source/WebCore/Modules/webdatabase/AbstractDatabase.h \
  • trunk/Source/WebCore/Modules/protocolhandler/NavigatorRegisterProtocolHandler.cpp

    r122445 r122810  
    3030#if ENABLE(REGISTER_PROTOCOL_HANDLER) || ENABLE(CUSTOM_SCHEME_HANDLER)
    3131
    32 #include "Chrome.h"
    33 #include "ChromeClient.h"
    3432#include "Document.h"
    3533#include "ExceptionCode.h"
     
    113111}
    114112
    115 NavigatorRegisterProtocolHandler::NavigatorRegisterProtocolHandler()
    116 {
     113NavigatorRegisterProtocolHandler* NavigatorRegisterProtocolHandler::from(Page* page)
     114{
     115    return static_cast<NavigatorRegisterProtocolHandler*>(RefCountedSupplement<Page, NavigatorRegisterProtocolHandler>::from(page, NavigatorRegisterProtocolHandler::supplementName()));
    117116}
    118117
    119118NavigatorRegisterProtocolHandler::~NavigatorRegisterProtocolHandler()
    120119{
     120}
     121
     122PassRefPtr<NavigatorRegisterProtocolHandler> NavigatorRegisterProtocolHandler::create(RegisterProtocolHandlerClient* client)
     123{
     124    return adoptRef(new NavigatorRegisterProtocolHandler(client));
    121125}
    122126
     
    139143        return;
    140144
    141     Page* page = navigator->frame()->page();
    142     if (!page)
    143         return;
    144 
    145     page->chrome()->client()->registerProtocolHandler(scheme, baseURL, url, navigator->frame()->displayStringModifiedByEncoding(title));
     145    NavigatorRegisterProtocolHandler::from(navigator->frame()->page())->client()->registerProtocolHandler(scheme, baseURL, url, navigator->frame()->displayStringModifiedByEncoding(title));
    146146}
    147147#endif
    148148
    149149#if ENABLE(CUSTOM_SCHEME_HANDLER)
    150 static String customHandlersStateString(const ChromeClient::CustomHandlersState state)
     150static String customHandlersStateString(const RegisterProtocolHandlerClient::CustomHandlersState state)
    151151{
    152152    DEFINE_STATIC_LOCAL(const String, newHandler, ("new"));
     
    155155
    156156    switch (state) {
    157     case ChromeClient::CustomHandlersNew:
     157    case RegisterProtocolHandlerClient::CustomHandlersNew:
    158158        return newHandler;
    159     case ChromeClient::CustomHandlersRegistered:
     159    case RegisterProtocolHandlerClient::CustomHandlersRegistered:
    160160        return registeredHandler;
    161     case ChromeClient::CustomHandlersDeclined:
     161    case RegisterProtocolHandlerClient::CustomHandlersDeclined:
    162162        return declinedHandler;
    163163    }
     
    183183        return declined;
    184184
    185     Page* page = navigator->frame()->page();
    186     if (!page)
    187         return declined;
    188 
    189     return customHandlersStateString(page->chrome()->client()->isProtocolHandlerRegistered(scheme, baseURL, url));
     185    return customHandlersStateString(NavigatorRegisterProtocolHandler::from(navigator->frame()->page())->client()->isProtocolHandlerRegistered(scheme, baseURL, url));
    190186}
    191187
     
    204200        return;
    205201
    206     Page* page = navigator->frame()->page();
    207     if (!page)
    208         return;
    209 
    210     page->chrome()->client()->unregisterProtocolHandler(scheme, baseURL, url);
     202    NavigatorRegisterProtocolHandler::from(navigator->frame()->page())->client()->unregisterProtocolHandler(scheme, baseURL, url);
    211203}
    212204#endif
    213205
     206const AtomicString& NavigatorRegisterProtocolHandler::supplementName()
     207{
     208    DEFINE_STATIC_LOCAL(AtomicString, name, ("NavigatorRegisterProtocolHandler"));
     209    return name;
     210}
     211
     212void provideRegisterProtocolHandlerTo(Page* page, RegisterProtocolHandlerClient* client)
     213{
     214    RefCountedSupplement<Page, NavigatorRegisterProtocolHandler>::provideTo(page, NavigatorRegisterProtocolHandler::supplementName(), NavigatorRegisterProtocolHandler::create(client));
     215}
     216
    214217} // namespace WebCore
    215218
  • trunk/Source/WebCore/Modules/protocolhandler/NavigatorRegisterProtocolHandler.h

    r122445 r122810  
    3030#if ENABLE(REGISTER_PROTOCOL_HANDLER) || ENABLE(CUSTOM_SCHEME_HANDLER)
    3131
     32#include "RefCountedSupplement.h"
     33#include "RegisterProtocolHandlerClient.h"
    3234#include <wtf/PassRefPtr.h>
    3335#include <wtf/text/WTFString.h>
     
    3537namespace WebCore {
    3638
     39class Page;
    3740class Navigator;
    3841
    3942typedef int ExceptionCode;
    4043
    41 class NavigatorRegisterProtocolHandler {
     44class NavigatorRegisterProtocolHandler : public RefCountedSupplement<Page, NavigatorRegisterProtocolHandler> {
    4245public:
     46    virtual ~NavigatorRegisterProtocolHandler();
     47
     48    static const AtomicString& supplementName();
     49    static NavigatorRegisterProtocolHandler* from(Page*);
     50
    4351#if ENABLE(REGISTER_PROTOCOL_HANDLER)
    4452    static void registerProtocolHandler(Navigator*, const String& scheme, const String& url, const String& title, ExceptionCode&);
     
    5058#endif
    5159
     60    static PassRefPtr<NavigatorRegisterProtocolHandler> create(RegisterProtocolHandlerClient*);
     61
    5262private:
    53     NavigatorRegisterProtocolHandler();
    54     ~NavigatorRegisterProtocolHandler();
     63    explicit NavigatorRegisterProtocolHandler(RegisterProtocolHandlerClient* client)
     64        : m_client(client)
     65    { }
     66
     67    RegisterProtocolHandlerClient* client() { return m_client; }
     68
     69    RegisterProtocolHandlerClient* m_client;
    5570};
    5671
  • trunk/Source/WebCore/WebCore.gypi

    r122773 r122810  
    15851585            'Modules/protocolhandler/NavigatorRegisterProtocolHandler.cpp',
    15861586            'Modules/protocolhandler/NavigatorRegisterProtocolHandler.h',
     1587            'Modules/protocolhandler/RegisterProtocolHandlerClient.h',
    15871588            'Modules/quota/DOMWindowQuota.cpp',
    15881589            'Modules/quota/DOMWindowQuota.h',
  • trunk/Source/WebCore/loader/EmptyClients.h

    r122558 r122810  
    129129#endif
    130130
    131 #if ENABLE(REGISTER_PROTOCOL_HANDLER)
    132     virtual void registerProtocolHandler(const String&, const String&, const String&, const String&) { }
    133 #endif
    134 
    135 #if ENABLE(CUSTOM_SCHEME_HANDLER)
    136     virtual CustomHandlersState isProtocolHandlerRegistered(const String&, const String&, const String&) { return CustomHandlersDeclined; }
    137     virtual void unregisterProtocolHandler(const String&, const String&, const String&) { }
    138 #endif
    139 
    140131    virtual void setStatusbarText(const String&) { }
    141132
  • trunk/Source/WebCore/page/ChromeClient.h

    r122676 r122810  
    147147        virtual void* webView() const = 0;
    148148
    149 #if ENABLE(REGISTER_PROTOCOL_HANDLER)
    150         virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title) = 0;
    151 #endif
    152 
    153 #if ENABLE(CUSTOM_SCHEME_HANDLER)
    154         enum CustomHandlersState {
    155             CustomHandlersNew,
    156             CustomHandlersRegistered,
    157             CustomHandlersDeclined
    158         };
    159 
    160         virtual CustomHandlersState isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url) = 0;
    161         virtual void unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url) = 0;
    162 #endif
    163 
    164149        virtual IntRect windowResizerRect() const = 0;
    165150
  • trunk/Source/WebKit/ChangeLog

    r122754 r122810  
     12012-07-16  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Add RegisterProtocolHandlerClient to the Modules/protocolhandler
     4        https://bugs.webkit.org/show_bug.cgi?id=90940
     5
     6        Reviewed by Hajime Morita.
     7
     8        As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs
     9        to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for
     10        protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient.
     11
     12        * PlatformEfl.cmake: Add RegisterProtocolHandlerEfl files and include path.
     13
    1142012-07-16  Joshua Netterfield  <jnetterfield@rim.com>
    215
  • trunk/Source/WebKit/PlatformEfl.cmake

    r122688 r122810  
    9999ENDIF ()
    100100
     101IF (ENABLE_REGISTER_PROTOCOL_HANDLER OR ENABLE_CUSTOM_SCHEME_HANDLER)
     102  LIST(APPEND WebKit_INCLUDE_DIRECTORIES
     103    "${WEBCORE_DIR}/Modules/protocolhandler"
     104  )
     105ENDIF ()
     106
    101107LIST(APPEND WebKit_SOURCES
    102108    efl/WebCoreSupport/AssertMatchingEnums.cpp
     
    117123    efl/WebCoreSupport/PageClientEfl.cpp
    118124    efl/WebCoreSupport/PlatformStrategiesEfl.cpp
     125    efl/WebCoreSupport/RegisterProtocolHandlerClientEfl.cpp
    119126    efl/WebCoreSupport/StorageTrackerClientEfl.cpp
    120127    efl/WebCoreSupport/VibrationClientEfl.cpp
  • trunk/Source/WebKit/chromium/ChangeLog

    r122807 r122810  
     12012-07-16  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Add RegisterProtocolHandlerClient to the Modules/protocolhandler
     4        https://bugs.webkit.org/show_bug.cgi?id=90940
     5
     6        Reviewed by Hajime Morita.
     7
     8        As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs
     9        to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for
     10        protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient.
     11
     12        In order to support this, RegisterProtocolHandlerClientImpl class is added to ChromeClientImpl files.
     13
     14        In addition, existing functions related to protocol handler in ChromeClientImpl class are moved to
     15        RegisterProtocolHandlerClientImpl class.
     16
     17        * WebKit.gyp:
     18        * src/ChromeClientImpl.cpp: Implement RegisterProtocolHandlerClientImpl class.
     19        (WebKit):
     20        (WebKit::RegisterProtocolHandlerClientImpl::create):
     21        (WebKit::RegisterProtocolHandlerClientImpl::RegisterProtocolHandlerClientImpl):
     22        (WebKit::RegisterProtocolHandlerClientImpl::registerProtocolHandler):
     23        * src/ChromeClientImpl.h:
     24        (ChromeClientImpl):
     25        (RegisterProtocolHandlerClientImpl):
     26        (WebKit::RegisterProtocolHandlerClientImpl::~RegisterProtocolHandlerClientImpl):
     27        (WebKit):
     28        * src/WebViewImpl.cpp: Register RegisterProtocolHandlerClientImpl in order to support supplement.
     29        (WebKit::WebViewImpl::WebViewImpl):
     30        * src/WebViewImpl.h:
     31
    1322012-07-16  Yoshifumi Inoue  <yosin@chromium.org>
    233
  • trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp

    r122558 r122810  
    104104#include "WrappedResourceRequest.h"
    105105#include <public/Platform.h>
     106#include <wtf/text/CString.h>
    106107#include <wtf/text/StringBuilder.h>
    107108#include <wtf/text/StringConcatenate.h>
     
    496497    return result;
    497498}
    498 
    499 #if ENABLE(REGISTER_PROTOCOL_HANDLER)
    500 void ChromeClientImpl::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
    501 {
    502     m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title);
    503 }
    504 #endif
    505499
    506500void ChromeClientImpl::invalidateRootView(const IntRect&, bool)
     
    11191113#endif
    11201114
     1115#if ENABLE(REGISTER_PROTOCOL_HANDLER)
     1116PassOwnPtr<RegisterProtocolHandlerClientImpl> RegisterProtocolHandlerClientImpl::create(WebViewImpl* webView)
     1117{
     1118    return adoptPtr(new RegisterProtocolHandlerClientImpl(webView));
     1119}
     1120
     1121RegisterProtocolHandlerClientImpl::RegisterProtocolHandlerClientImpl(WebViewImpl* webView)
     1122    : m_webView(webView)
     1123{
     1124}
     1125
     1126void RegisterProtocolHandlerClientImpl::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
     1127{
     1128    m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title);
     1129}
     1130#endif
     1131
    11211132} // namespace WebKit
  • trunk/Source/WebKit/chromium/src/ChromeClientImpl.h

    r122558 r122810  
    3535#include "ChromeClientChromium.h"
    3636#include "PopupMenu.h"
     37#include "RegisterProtocolHandlerClient.h"
    3738#include "SearchPopupMenu.h"
    3839#include "WebNavigationPolicy.h"
     40#include <wtf/PassOwnPtr.h>
    3941
    4042namespace WebCore {
     
    108110    virtual WebCore::KeyboardUIMode keyboardUIMode();
    109111    virtual WebCore::IntRect windowResizerRect() const;
    110 #if ENABLE(REGISTER_PROTOCOL_HANDLER)
    111     virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title);
    112 #endif
    113112    virtual void invalidateRootView(const WebCore::IntRect&, bool);
    114113    virtual void invalidateContentsAndRootView(const WebCore::IntRect&, bool);
     
    236235};
    237236
     237class RegisterProtocolHandlerClientImpl : public WebCore::RegisterProtocolHandlerClient {
     238public:
     239    static PassOwnPtr<RegisterProtocolHandlerClientImpl> create(WebViewImpl*);
     240    ~RegisterProtocolHandlerClientImpl() { }
     241
     242    virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title) OVERRIDE;
     243
     244private:
     245    explicit RegisterProtocolHandlerClientImpl(WebViewImpl*);
     246
     247    WebViewImpl* m_webView;
     248};
     249
    238250} // namespace WebKit
    239251
  • trunk/Source/WebKit/chromium/src/WebViewImpl.cpp

    r122743 r122810  
    429429    , m_userMediaClientImpl(this)
    430430#endif
     431#if ENABLE(REGISTER_PROTOCOL_HANDLER)
     432    , m_registerProtocolHandlerClient(RegisterProtocolHandlerClientImpl::create(this))
     433#endif
    431434    , m_flingModifier(0)
    432435{
     
    457460#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
    458461    provideNotification(m_page.get(), notificationPresenterImpl());
     462#endif
     463#if ENABLE(REGISTER_PROTOCOL_HANDLER)
     464    provideRegisterProtocolHandlerTo(m_page.get(), m_registerProtocolHandlerClient.get());
    459465#endif
    460466
  • trunk/Source/WebKit/chromium/src/WebViewImpl.h

    r122558 r122810  
    822822    UserMediaClientImpl m_userMediaClientImpl;
    823823#endif
     824#if ENABLE(REGISTER_PROTOCOL_HANDLER)
     825    OwnPtr<RegisterProtocolHandlerClientImpl> m_registerProtocolHandlerClient;
     826#endif
    824827    OwnPtr<WebCore::ActivePlatformGestureAnimation> m_gestureAnimation;
    825828    WebPoint m_lastWheelPosition;
  • trunk/Source/WebKit/efl/ChangeLog

    r122743 r122810  
     12012-07-16  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Add RegisterProtocolHandlerClient to the Modules/protocolhandler
     4        https://bugs.webkit.org/show_bug.cgi?id=90940
     5
     6        Reviewed by Hajime Morita.
     7
     8        As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs
     9        to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for
     10        protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient
     11
     12        In order to support this, RegisterProtocolHandlerClientEfl class is added and ewk_view registers
     13        RegisterProtocolHandlerClientEfl. In addition, existing concrete functions in ChromeClientEfl are moved
     14        to RegisterProtocolHandlerClientEfl.
     15
     16        * WebCoreSupport/ChromeClientEfl.cpp:
     17        (WebCore):
     18        * WebCoreSupport/ChromeClientEfl.h:
     19        * WebCoreSupport/RegisterProtocolHandlerClientEfl.cpp: Added.
     20        (WebCore):
     21        (WebCore::customHandlerDataCreate):
     22        (WebCore::customHandlerDataDelete):
     23        (WebCore::RegisterProtocolHandlerClientEfl::RegisterProtocolHandlerClientEfl):
     24        (WebCore::RegisterProtocolHandlerClientEfl::registerProtocolHandler):
     25        (WebCore::RegisterProtocolHandlerClientEfl::isProtocolHandlerRegistered):
     26        (WebCore::RegisterProtocolHandlerClientEfl::unregisterProtocolHandler):
     27        * WebCoreSupport/RegisterProtocolHandlerClientEfl.h: Added.
     28        (RegisterProtocolHandlerClientEfl):
     29        (WebCore::RegisterProtocolHandlerClientEfl::~RegisterProtocolHandlerClientEfl):
     30        * ewk/ewk_view.cpp:
     31        (_ewk_view_priv_new):
     32
    1332012-07-16  Kihong Kwon  <kihong.kwon@samsung.com>
    234
  • trunk/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp

    r122078 r122810  
    651651#endif
    652652
    653 #if ENABLE(REGISTER_PROTOCOL_HANDLER) || ENABLE(CUSTOM_SCHEME_HANDLER)
    654 static Ewk_Custom_Handler_Data* customHandlerDataCreate(Evas_Object* ewkView, const char* scheme, const char* baseURL, const char* url)
    655 {
    656     Ewk_Custom_Handler_Data* data = new Ewk_Custom_Handler_Data;
    657     data->ewkView = ewkView;
    658     data->scheme = eina_stringshare_add(scheme);
    659     data->base_url = eina_stringshare_add(baseURL);
    660     data->url = eina_stringshare_add(url);
    661     return data;
    662 }
    663 
    664 static void customHandlerDataDelete(Ewk_Custom_Handler_Data* data)
    665 {
    666     eina_stringshare_del(data->scheme);
    667     eina_stringshare_del(data->base_url);
    668     eina_stringshare_del(data->url);
    669     delete data;
    670 }
    671 
    672 #if ENABLE(REGISTER_PROTOCOL_HANDLER)
    673 void ChromeClientEfl::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
    674 {
    675     Ewk_Custom_Handler_Data* data = customHandlerDataCreate(m_view, scheme.utf8().data(), baseURL.utf8().data(), url.utf8().data());
    676     data->title = eina_stringshare_add(title.utf8().data());
    677     ewk_custom_handler_register_protocol_handler(data);
    678     eina_stringshare_del(data->title);
    679     customHandlerDataDelete(data);
    680 }
    681 #endif
    682 
    683 #if ENABLE(CUSTOM_SCHEME_HANDLER)
    684 ChromeClient::CustomHandlersState ChromeClientEfl::isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url)
    685 {
    686     Ewk_Custom_Handler_Data* data = customHandlerDataCreate(m_view, scheme.utf8().data(), baseURL.utf8().data(), url.utf8().data());
    687     ChromeClient::CustomHandlersState result = static_cast<CustomHandlersState>(ewk_custom_handler_register_protocol_handler(data));
    688     customHandlerDataDelete(data);
    689 
    690     return result;
    691 }
    692 
    693 void ChromeClientEfl::unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url)
    694 {
    695     Ewk_Custom_Handler_Data* data = customHandlerDataCreate(m_view, scheme.utf8().data(), baseURL.utf8().data(), url.utf8().data());
    696     ewk_custom_handler_register_protocol_handler(data);
    697     customHandlerDataDelete(data);
    698 }
    699 #endif
    700 
    701 #endif // ENABLE(REGISTER_PROTOCOL_HANDLER) || ENABLE(CUSTOM_SCHEME_HANDLER)
    702 
    703 }
     653}
  • trunk/Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h

    r122078 r122810  
    182182    virtual void numTouchEventHandlersChanged(unsigned) { }
    183183
    184 #if ENABLE(REGISTER_PROTOCOL_HANDLER)
    185     virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title);
    186 #endif
    187 
    188 #if ENABLE(CUSTOM_SCHEME_HANDLER)
    189     virtual CustomHandlersState isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url);
    190     virtual void unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url);
    191 #endif
    192 
    193184    Evas_Object* m_view;
    194185    KURL m_hoveredLinkURL;
  • trunk/Source/WebKit/efl/ewk/ewk_view.cpp

    r122743 r122810  
    102102#if ENABLE(INPUT_TYPE_COLOR)
    103103#include "ColorChooserClient.h"
     104#endif
     105
     106#if ENABLE(REGISTER_PROTOCOL_HANDLER) || ENABLE(CUSTOM_SCHEME_HANDLER)
     107#include "RegisterProtocolHandlerClientEfl.h"
    104108#endif
    105109
     
    758762#endif
    759763
     764#if ENABLE(REGISTER_PROTOCOL_HANDLER) || ENABLE(CUSTOM_SCHEME_HANDLER)
     765    WebCore::provideRegisterProtocolHandlerTo(priv->page.get(), new WebCore::RegisterProtocolHandlerClientEfl(smartData->self));
     766#endif
     767
    760768    priv->pageSettings = priv->page->settings();
    761769
  • trunk/Source/WebKit/gtk/ChangeLog

    r122708 r122810  
     12012-07-16  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Add RegisterProtocolHandlerClient to the Modules/protocolhandler
     4        https://bugs.webkit.org/show_bug.cgi?id=90940
     5
     6        Reviewed by Hajime Morita.
     7
     8        As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs
     9        to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for
     10        protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient.
     11
     12        In order to support this, RegisterProtocolHandlerClientGtk class is added and webview registers
     13        RegisterProtocolHandlerClientGtk. In addition, existing concrete functions in ChromeClientGtk are moved
     14        to RegisterProtocolHandlerClientGtk.
     15
     16        * GNUmakefile.am:
     17        * WebCoreSupport/ChromeClientGtk.cpp:
     18        * WebCoreSupport/ChromeClientGtk.h:
     19        (ChromeClient):
     20        * WebCoreSupport/RegisterProtocolHandlerClientGtk.cpp: Added.
     21        (WebKit):
     22        (WebKit::RegisterProtocolHandlerClient::RegisterProtocolHandlerClient):
     23        (WebKit::RegisterProtocolHandlerClient::registerProtocolHandler):
     24        * WebCoreSupport/RegisterProtocolHandlerClientGtk.h: Added.
     25        (WebKit):
     26        (RegisterProtocolHandlerClient):
     27        (WebKit::RegisterProtocolHandlerClient::~RegisterProtocolHandlerClient):
     28        * webkit/webkitwebview.cpp:
     29        (webkit_web_view_init):
     30
    1312012-07-16  Carlos Garcia Campos  <cgarcia@igalia.com>
    232
  • trunk/Source/WebKit/gtk/GNUmakefile.am

    r121332 r122810  
    214214        Source/WebKit/gtk/WebCoreSupport/PlatformStrategiesGtk.h \
    215215        Source/WebKit/gtk/WebCoreSupport/PlatformStrategiesGtk.cpp \
     216        Source/WebKit/gtk/WebCoreSupport/RegisterProtocolHandlerClientGtk.h \
     217        Source/WebKit/gtk/WebCoreSupport/RegisterProtocolHandlerClientGtk.cpp \
    216218        Source/WebKit/gtk/WebCoreSupport/UserMediaClientGtk.cpp \
    217219        Source/WebKit/gtk/WebCoreSupport/UserMediaClientGtk.h \
  • trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp

    r122054 r122810  
    387387}
    388388
    389 #if ENABLE(REGISTER_PROTOCOL_HANDLER)
    390 void ChromeClient::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
    391 {
    392     notImplemented();
    393 }
    394 #endif
    395 
    396389static gboolean repaintEverythingSoonTimeout(ChromeClient* client)
    397390{
  • trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h

    r117947 r122810  
    100100
    101101        virtual IntRect windowResizerRect() const;
    102 #if ENABLE(REGISTER_PROTOCOL_HANDLER)
    103         virtual void registerProtocolHandler(const WTF::String&, const WTF::String&, const WTF::String&, const WTF::String&);
    104 #endif
    105102        virtual void invalidateRootView(const IntRect&, bool);
    106103        virtual void invalidateContentsAndRootView(const IntRect&, bool);
  • trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp

    r122280 r122810  
    117117#include "DeviceMotionClientGtk.h"
    118118#include "DeviceOrientationClientGtk.h"
     119#endif
     120
     121#if ENABLE(REGISTER_PROTOCOL_HANDLER)
     122#include "RegisterProtocolHandlerClientGtk.h"
    119123#endif
    120124
     
    36313635#endif
    36323636
     3637#if ENABLE(REGISTER_PROTOCOL_HANDLER)
     3638    WebCore::provideRegisterProtocolHandlerTo(priv->corePage, new WebKit::RegisterProtocolHandlerClient);
     3639#endif
     3640
    36333641    if (DumpRenderTreeSupportGtk::dumpRenderTreeModeEnabled()) {
    36343642        // Set some testing-specific settings
  • trunk/Source/WebKit2/ChangeLog

    r122806 r122810  
     12012-07-16  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
     2
     3        Add RegisterProtocolHandlerClient to the Modules/protocolhandler
     4        https://bugs.webkit.org/show_bug.cgi?id=90940
     5
     6        Reviewed by Hajime Morita.
     7
     8        As a step to let protocol handler be moved to the modules, RegisterProtocolHandlerClient needs
     9        to be added to the Modules/protocolhandler. Because ChromeClient has some virtual functions for
     10        protocol handlers, virtual functions should be moved to RegisterProtocolHandlerClient.
     11
     12        In order to support this, WebRegisterProtocolHandlerClient class is added. However, this is not implemented yet.
     13        In addition, existing virtual functions in WebChromeClient are moved to WebRegisterProtocolHandlerClient.
     14
     15        * WebProcess/WebCoreSupport/WebChromeClient.h:
     16        * WebProcess/WebCoreSupport/WebRegisterProtocolHandlerClient.h: Added.
     17        (WebKit):
     18        (WebRegisterProtoclHandlerClient):
     19        (WebKit::WebRegisterProtoclHandlerClient::isProtocolHandlerRegistered):
     20        (WebKit::WebRegisterProtoclHandlerClient::unregisterProtocolHandler):
     21
    1222012-07-16  Pete Williamson  <petewil@google.com>
    223
  • trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h

    r122676 r122810  
    221221    virtual void numTouchEventHandlersChanged(unsigned) OVERRIDE { }
    222222
    223 #if ENABLE(REGISTER_PROTOCOL_HANDLER)
    224     virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title) OVERRIDE { }
    225 #endif
    226 
    227 #if ENABLE(CUSTOM_SCHEME_HANDLER)
    228     virtual CustomHandlersState isProtocolHandlerRegistered(const String&, const String&, const String&) { return CustomHandlersDeclined; }
    229     virtual void unregisterProtocolHandler(const String&, const String&, const String&) { }
    230 #endif
    231 
    232223    String m_cachedToolTip;
    233224    mutable RefPtr<WebFrame> m_cachedFrameSetLargestFrame;
Note: See TracChangeset for help on using the changeset viewer.