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):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@122810 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 35d6bcda
2012-07-16 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Add RegisterProtocolHandlerClient to the Modules/protocolhandler
https://bugs.webkit.org/show_bug.cgi?id=90940
Reviewed by Hajime Morita.
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):
2012-07-16 Pete Williamson <petewil@google.com>
Changed the behavior of iconURLs to always recalculate the list.
......@@ -1209,6 +1209,7 @@ webcore_modules_sources += \
Source/WebCore/Modules/notifications/WorkerContextNotifications.h \
Source/WebCore/Modules/protocolhandler/NavigatorRegisterProtocolHandler.cpp \
Source/WebCore/Modules/protocolhandler/NavigatorRegisterProtocolHandler.h \
Source/WebCore/Modules/protocolhandler/RegisterProtocolHandlerClient.h \
Source/WebCore/Modules/webdatabase/AbstractDatabase.cpp \
Source/WebCore/Modules/webdatabase/AbstractDatabase.h \
Source/WebCore/Modules/webdatabase/ChangeVersionWrapper.cpp \
......
......@@ -29,8 +29,6 @@
#if ENABLE(REGISTER_PROTOCOL_HANDLER) || ENABLE(CUSTOM_SCHEME_HANDLER)
#include "Chrome.h"
#include "ChromeClient.h"
#include "Document.h"
#include "ExceptionCode.h"
#include "Frame.h"
......@@ -112,14 +110,20 @@ static bool verifyProtocolHandlerScheme(const String& scheme, ExceptionCode& ec)
return false;
}
NavigatorRegisterProtocolHandler::NavigatorRegisterProtocolHandler()
NavigatorRegisterProtocolHandler* NavigatorRegisterProtocolHandler::from(Page* page)
{
return static_cast<NavigatorRegisterProtocolHandler*>(RefCountedSupplement<Page, NavigatorRegisterProtocolHandler>::from(page, NavigatorRegisterProtocolHandler::supplementName()));
}
NavigatorRegisterProtocolHandler::~NavigatorRegisterProtocolHandler()
{
}
PassRefPtr<NavigatorRegisterProtocolHandler> NavigatorRegisterProtocolHandler::create(RegisterProtocolHandlerClient* client)
{
return adoptRef(new NavigatorRegisterProtocolHandler(client));
}
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
void NavigatorRegisterProtocolHandler::registerProtocolHandler(Navigator* navigator, const String& scheme, const String& url, const String& title, ExceptionCode& ec)
{
......@@ -138,27 +142,23 @@ void NavigatorRegisterProtocolHandler::registerProtocolHandler(Navigator* naviga
if (!verifyProtocolHandlerScheme(scheme, ec))
return;
Page* page = navigator->frame()->page();
if (!page)
return;
page->chrome()->client()->registerProtocolHandler(scheme, baseURL, url, navigator->frame()->displayStringModifiedByEncoding(title));
NavigatorRegisterProtocolHandler::from(navigator->frame()->page())->client()->registerProtocolHandler(scheme, baseURL, url, navigator->frame()->displayStringModifiedByEncoding(title));
}
#endif
#if ENABLE(CUSTOM_SCHEME_HANDLER)
static String customHandlersStateString(const ChromeClient::CustomHandlersState state)
static String customHandlersStateString(const RegisterProtocolHandlerClient::CustomHandlersState state)
{
DEFINE_STATIC_LOCAL(const String, newHandler, ("new"));
DEFINE_STATIC_LOCAL(const String, registeredHandler, ("registered"));
DEFINE_STATIC_LOCAL(const String, declinedHandler, ("declined"));
switch (state) {
case ChromeClient::CustomHandlersNew:
case RegisterProtocolHandlerClient::CustomHandlersNew:
return newHandler;
case ChromeClient::CustomHandlersRegistered:
case RegisterProtocolHandlerClient::CustomHandlersRegistered:
return registeredHandler;
case ChromeClient::CustomHandlersDeclined:
case RegisterProtocolHandlerClient::CustomHandlersDeclined:
return declinedHandler;
}
......@@ -182,11 +182,7 @@ String NavigatorRegisterProtocolHandler::isProtocolHandlerRegistered(Navigator*
if (!verifyProtocolHandlerScheme(scheme, ec))
return declined;
Page* page = navigator->frame()->page();
if (!page)
return declined;
return customHandlersStateString(page->chrome()->client()->isProtocolHandlerRegistered(scheme, baseURL, url));
return customHandlersStateString(NavigatorRegisterProtocolHandler::from(navigator->frame()->page())->client()->isProtocolHandlerRegistered(scheme, baseURL, url));
}
void NavigatorRegisterProtocolHandler::unregisterProtocolHandler(Navigator* navigator, const String& scheme, const String& url, ExceptionCode& ec)
......@@ -203,14 +199,21 @@ void NavigatorRegisterProtocolHandler::unregisterProtocolHandler(Navigator* navi
if (!verifyProtocolHandlerScheme(scheme, ec))
return;
Page* page = navigator->frame()->page();
if (!page)
return;
page->chrome()->client()->unregisterProtocolHandler(scheme, baseURL, url);
NavigatorRegisterProtocolHandler::from(navigator->frame()->page())->client()->unregisterProtocolHandler(scheme, baseURL, url);
}
#endif
const AtomicString& NavigatorRegisterProtocolHandler::supplementName()
{
DEFINE_STATIC_LOCAL(AtomicString, name, ("NavigatorRegisterProtocolHandler"));
return name;
}
void provideRegisterProtocolHandlerTo(Page* page, RegisterProtocolHandlerClient* client)
{
RefCountedSupplement<Page, NavigatorRegisterProtocolHandler>::provideTo(page, NavigatorRegisterProtocolHandler::supplementName(), NavigatorRegisterProtocolHandler::create(client));
}
} // namespace WebCore
#endif // ENABLE(REGISTER_PROTOCOL_HANDLER) || ENABLE(CUSTOM_SCHEME_HANDLER)
......
......@@ -29,17 +29,25 @@
#if ENABLE(REGISTER_PROTOCOL_HANDLER) || ENABLE(CUSTOM_SCHEME_HANDLER)
#include "RefCountedSupplement.h"
#include "RegisterProtocolHandlerClient.h"
#include <wtf/PassRefPtr.h>
#include <wtf/text/WTFString.h>
namespace WebCore {
class Page;
class Navigator;
typedef int ExceptionCode;
class NavigatorRegisterProtocolHandler {
class NavigatorRegisterProtocolHandler : public RefCountedSupplement<Page, NavigatorRegisterProtocolHandler> {
public:
virtual ~NavigatorRegisterProtocolHandler();
static const AtomicString& supplementName();
static NavigatorRegisterProtocolHandler* from(Page*);
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
static void registerProtocolHandler(Navigator*, const String& scheme, const String& url, const String& title, ExceptionCode&);
#endif
......@@ -49,9 +57,16 @@ public:
static void unregisterProtocolHandler(Navigator*, const String& scheme, const String& url, ExceptionCode&);
#endif
static PassRefPtr<NavigatorRegisterProtocolHandler> create(RegisterProtocolHandlerClient*);
private:
NavigatorRegisterProtocolHandler();
~NavigatorRegisterProtocolHandler();
explicit NavigatorRegisterProtocolHandler(RegisterProtocolHandlerClient* client)
: m_client(client)
{ }
RegisterProtocolHandlerClient* client() { return m_client; }
RegisterProtocolHandlerClient* m_client;
};
} // namespace WebCore
......
/*
* Copyright (C) 2012 Samsung Electronics. 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. ``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
* 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 RegisterProtocolHandlerClient_h
#define RegisterProtocolHandlerClient_h
#if ENABLE(REGISTER_PROTOCOL_HANDLER) || ENABLE(CUSTOM_SCHEME_HANDLER)
#include <wtf/text/WTFString.h>
namespace WebCore {
class Page;
class RegisterProtocolHandlerClient {
public:
virtual ~RegisterProtocolHandlerClient() { }
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title) = 0;
#endif
#if ENABLE(CUSTOM_SCHEME_HANDLER)
enum CustomHandlersState {
CustomHandlersNew,
CustomHandlersRegistered,
CustomHandlersDeclined
};
virtual CustomHandlersState isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url) = 0;
virtual void unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url) = 0;
#endif
};
void provideRegisterProtocolHandlerTo(Page*, RegisterProtocolHandlerClient*);
}
#endif
#endif // RegisterProtocolHandlerClient_h
......@@ -1584,6 +1584,7 @@
'Modules/notifications/WorkerContextNotifications.h',
'Modules/protocolhandler/NavigatorRegisterProtocolHandler.cpp',
'Modules/protocolhandler/NavigatorRegisterProtocolHandler.h',
'Modules/protocolhandler/RegisterProtocolHandlerClient.h',
'Modules/quota/DOMWindowQuota.cpp',
'Modules/quota/DOMWindowQuota.h',
'Modules/quota/StorageInfo.cpp',
......
......@@ -128,15 +128,6 @@ public:
virtual void resetPagePopupDriver() OVERRIDE { }
#endif
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
virtual void registerProtocolHandler(const String&, const String&, const String&, const String&) { }
#endif
#if ENABLE(CUSTOM_SCHEME_HANDLER)
virtual CustomHandlersState isProtocolHandlerRegistered(const String&, const String&, const String&) { return CustomHandlersDeclined; }
virtual void unregisterProtocolHandler(const String&, const String&, const String&) { }
#endif
virtual void setStatusbarText(const String&) { }
virtual KeyboardUIMode keyboardUIMode() { return KeyboardAccessDefault; }
......
......@@ -146,21 +146,6 @@ namespace WebCore {
virtual void* webView() const = 0;
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title) = 0;
#endif
#if ENABLE(CUSTOM_SCHEME_HANDLER)
enum CustomHandlersState {
CustomHandlersNew,
CustomHandlersRegistered,
CustomHandlersDeclined
};
virtual CustomHandlersState isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url) = 0;
virtual void unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url) = 0;
#endif
virtual IntRect windowResizerRect() const = 0;
// Methods used by HostWindow.
......
2012-07-16 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Add RegisterProtocolHandlerClient to the Modules/protocolhandler
https://bugs.webkit.org/show_bug.cgi?id=90940
Reviewed by Hajime Morita.
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.
2012-07-16 Joshua Netterfield <jnetterfield@rim.com>
[BlackBerry] Upstream WebGL Code
......
......@@ -98,6 +98,12 @@ IF (ENABLE_BATTERY_STATUS)
)
ENDIF ()
IF (ENABLE_REGISTER_PROTOCOL_HANDLER OR ENABLE_CUSTOM_SCHEME_HANDLER)
LIST(APPEND WebKit_INCLUDE_DIRECTORIES
"${WEBCORE_DIR}/Modules/protocolhandler"
)
ENDIF ()
LIST(APPEND WebKit_SOURCES
efl/WebCoreSupport/AssertMatchingEnums.cpp
efl/WebCoreSupport/BatteryClientEfl.cpp
......@@ -116,6 +122,7 @@ LIST(APPEND WebKit_SOURCES
efl/WebCoreSupport/NotificationPresenterClientEfl.cpp
efl/WebCoreSupport/PageClientEfl.cpp
efl/WebCoreSupport/PlatformStrategiesEfl.cpp
efl/WebCoreSupport/RegisterProtocolHandlerClientEfl.cpp
efl/WebCoreSupport/StorageTrackerClientEfl.cpp
efl/WebCoreSupport/VibrationClientEfl.cpp
......
2012-07-16 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Add RegisterProtocolHandlerClient to the Modules/protocolhandler
https://bugs.webkit.org/show_bug.cgi?id=90940
Reviewed by Hajime Morita.
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:
2012-07-16 Yoshifumi Inoue <yosin@chromium.org>
REGRESSION(r122552): DecimalTest tests (CeilingSmallExponent and FloorSmallExponent) started failing.
......
......@@ -103,6 +103,7 @@
#include "WindowFeatures.h"
#include "WrappedResourceRequest.h"
#include <public/Platform.h>
#include <wtf/text/CString.h>
#include <wtf/text/StringBuilder.h>
#include <wtf/text/StringConcatenate.h>
#include <wtf/unicode/CharacterNames.h>
......@@ -496,13 +497,6 @@ IntRect ChromeClientImpl::windowResizerRect() const
return result;
}
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
void ChromeClientImpl::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
{
m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title);
}
#endif
void ChromeClientImpl::invalidateRootView(const IntRect&, bool)
{
notImplemented();
......@@ -1118,4 +1112,21 @@ bool ChromeClientImpl::isPointerLocked()
}
#endif
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
PassOwnPtr<RegisterProtocolHandlerClientImpl> RegisterProtocolHandlerClientImpl::create(WebViewImpl* webView)
{
return adoptPtr(new RegisterProtocolHandlerClientImpl(webView));
}
RegisterProtocolHandlerClientImpl::RegisterProtocolHandlerClientImpl(WebViewImpl* webView)
: m_webView(webView)
{
}
void RegisterProtocolHandlerClientImpl::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
{
m_webView->client()->registerProtocolHandler(scheme, baseURL, url, title);
}
#endif
} // namespace WebKit
......@@ -34,8 +34,10 @@
#include "ChromeClientChromium.h"
#include "PopupMenu.h"
#include "RegisterProtocolHandlerClient.h"
#include "SearchPopupMenu.h"
#include "WebNavigationPolicy.h"
#include <wtf/PassOwnPtr.h>
namespace WebCore {
class AccessibilityObject;
......@@ -107,9 +109,6 @@ public:
virtual bool shouldInterruptJavaScript();
virtual WebCore::KeyboardUIMode keyboardUIMode();
virtual WebCore::IntRect windowResizerRect() const;
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title);
#endif
virtual void invalidateRootView(const WebCore::IntRect&, bool);
virtual void invalidateContentsAndRootView(const WebCore::IntRect&, bool);
virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
......@@ -235,6 +234,19 @@ private:
#endif
};
class RegisterProtocolHandlerClientImpl : public WebCore::RegisterProtocolHandlerClient {
public:
static PassOwnPtr<RegisterProtocolHandlerClientImpl> create(WebViewImpl*);
~RegisterProtocolHandlerClientImpl() { }
virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title) OVERRIDE;
private:
explicit RegisterProtocolHandlerClientImpl(WebViewImpl*);
WebViewImpl* m_webView;
};
} // namespace WebKit
#endif
......@@ -427,6 +427,9 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
, m_emulatedTextZoomFactor(1)
#if ENABLE(MEDIA_STREAM)
, m_userMediaClientImpl(this)
#endif
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
, m_registerProtocolHandlerClient(RegisterProtocolHandlerClientImpl::create(this))
#endif
, m_flingModifier(0)
{
......@@ -457,6 +460,9 @@ WebViewImpl::WebViewImpl(WebViewClient* client)
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
provideNotification(m_page.get(), notificationPresenterImpl());
#endif
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
provideRegisterProtocolHandlerTo(m_page.get(), m_registerProtocolHandlerClient.get());
#endif
provideContextFeaturesTo(m_page.get(), m_featureSwitchClient.get());
provideDeviceOrientationTo(m_page.get(), m_deviceOrientationClientProxy.get());
......
......@@ -820,6 +820,9 @@ private:
#if ENABLE(MEDIA_STREAM)
UserMediaClientImpl m_userMediaClientImpl;
#endif
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
OwnPtr<RegisterProtocolHandlerClientImpl> m_registerProtocolHandlerClient;
#endif
OwnPtr<WebCore::ActivePlatformGestureAnimation> m_gestureAnimation;
WebPoint m_lastWheelPosition;
......
2012-07-16 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Add RegisterProtocolHandlerClient to the Modules/protocolhandler
https://bugs.webkit.org/show_bug.cgi?id=90940
Reviewed by Hajime Morita.
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):
2012-07-16 Kihong Kwon <kihong.kwon@samsung.com>
Remove setController from BatteryClient
......
......@@ -650,54 +650,4 @@ void ChromeClientEfl::exitFullScreenForElement(WebCore::Element*)
}
#endif
#if ENABLE(REGISTER_PROTOCOL_HANDLER) || ENABLE(CUSTOM_SCHEME_HANDLER)
static Ewk_Custom_Handler_Data* customHandlerDataCreate(Evas_Object* ewkView, const char* scheme, const char* baseURL, const char* url)
{
Ewk_Custom_Handler_Data* data = new Ewk_Custom_Handler_Data;
data->ewkView = ewkView;
data->scheme = eina_stringshare_add(scheme);
data->base_url = eina_stringshare_add(baseURL);
data->url = eina_stringshare_add(url);
return data;
}
static void customHandlerDataDelete(Ewk_Custom_Handler_Data* data)
{
eina_stringshare_del(data->scheme);
eina_stringshare_del(data->base_url);
eina_stringshare_del(data->url);
delete data;
}
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
void ChromeClientEfl::registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title)
{
Ewk_Custom_Handler_Data* data = customHandlerDataCreate(m_view, scheme.utf8().data(), baseURL.utf8().data(), url.utf8().data());
data->title = eina_stringshare_add(title.utf8().data());
ewk_custom_handler_register_protocol_handler(data);
eina_stringshare_del(data->title);
customHandlerDataDelete(data);
}
#endif
#if ENABLE(CUSTOM_SCHEME_HANDLER)
ChromeClient::CustomHandlersState ChromeClientEfl::isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url)
{
Ewk_Custom_Handler_Data* data = customHandlerDataCreate(m_view, scheme.utf8().data(), baseURL.utf8().data(), url.utf8().data());
ChromeClient::CustomHandlersState result = static_cast<CustomHandlersState>(ewk_custom_handler_register_protocol_handler(data));
customHandlerDataDelete(data);
return result;
}
void ChromeClientEfl::unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url)
{
Ewk_Custom_Handler_Data* data = customHandlerDataCreate(m_view, scheme.utf8().data(), baseURL.utf8().data(), url.utf8().data());
ewk_custom_handler_register_protocol_handler(data);
customHandlerDataDelete(data);
}
#endif
#endif // ENABLE(REGISTER_PROTOCOL_HANDLER) || ENABLE(CUSTOM_SCHEME_HANDLER)
}
......@@ -181,15 +181,6 @@ public:
virtual void numWheelEventHandlersChanged(unsigned) { }
virtual void numTouchEventHandlersChanged(unsigned) { }
#if ENABLE(REGISTER_PROTOCOL_HANDLER)
virtual void registerProtocolHandler(const String& scheme, const String& baseURL, const String& url, const String& title);
#endif
#if ENABLE(CUSTOM_SCHEME_HANDLER)
virtual CustomHandlersState isProtocolHandlerRegistered(const String& scheme, const String& baseURL, const String& url);
virtual void unregisterProtocolHandler(const String& scheme, const String& baseURL, const String& url);
#endif
Evas_Object* m_view;
KURL m_hoveredLinkURL;
#if ENABLE(FULLSCREEN_API)
......