Changeset 164271 in webkit


Ignore:
Timestamp:
Feb 17, 2014 9:13:18 PM (10 years ago)
Author:
ryuan.choi@samsung.com
Message:

[EFL][WK2] Move and make WKColorPickerResultListener to EFL specific interface
https://bugs.webkit.org/show_bug.cgi?id=119120

Reviewed by Gyuyoung Kim.

WKColorPickerResultListener and related files are only used in EFL since added.
Indeed, it does not work since refactored common logic for ColorPicker in WebPageProxy.

This patch moved them to EFL specfic and refactor to work well.

  • CMakeLists.txt: Moved WebColorPickerResultListenerProxy.cpp to PlatformEfl.cmake.
  • GNUmakefile.list.am: Removed ColorPickerResultListener related files which are only for Efl from source list.
  • PlatformEfl.cmake: Added ColorPickerResultListenerProxy related files and newly added files into source list.
  • UIProcess/API/APIUIClient.h:
  • UIProcess/API/C/WKPage.cpp:

(WKPageSetPageUIClient):

  • UIProcess/API/C/efl/WKColorPickerResultListener.cpp: Renamed from Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.cpp.

(WKColorPickerResultListenerGetTypeID):
(WKColorPickerResultListenerSetColor):

  • UIProcess/API/C/efl/WKColorPickerResultListener.h: Renamed from Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.h.
  • UIProcess/API/C/efl/WKViewEfl.cpp: Introduced WKColorPickerClient and setter.

(WKViewSetColorPickerClient):

  • UIProcess/API/C/efl/WKViewEfl.h:
  • UIProcess/API/efl/tests/test_ewk2_color_picker.cpp: Enabled test case for color picker.

(TEST_F):

  • UIProcess/WebPageProxy.cpp: Removed unnecessary WebColorPickerResultListenerProxy dependency.
  • UIProcess/WebPageProxy.h: Ditto.
  • UIProcess/efl/PageUIClientEfl.cpp: Removed color picker callbacks of PageUIClient.

(WebKit::PageUIClientEfl::PageUIClientEfl):

  • UIProcess/efl/PageUIClientEfl.h:
  • UIProcess/efl/ViewClientEfl.cpp: Registered callbacks of WKColorPickerClient.

(WebKit::ViewClientEfl::showColorPicker):
(WebKit::ViewClientEfl::endColorPicker):
(WebKit::ViewClientEfl::ViewClientEfl):
(WebKit::ViewClientEfl::~ViewClientEfl):

  • UIProcess/efl/ViewClientEfl.h:
  • UIProcess/efl/WebColorPickerClient.cpp: Copied from Source/WebKit2/UIProcess/efl/ViewClientEfl.h.

(WebKit::WebColorPickerClient::showColorPicker):
(WebKit::WebColorPickerClient::endPicker):

  • UIProcess/efl/WebColorPickerClient.h: Added.
  • UIProcess/efl/WebColorPickerEfl.cpp: Copied from Source/WebKit2/UIProcess/efl/ViewClientEfl.h.

(WebKit::WebColorPickerEfl::WebColorPickerEfl):
(WebKit::WebColorPickerEfl::endPicker):
(WebKit::WebColorPickerEfl::showColorPicker):
(WebKit::WebColorPickerEfl::setSelectedColor):
(WebKit::WebColorPickerEfl::didChooseColor):

  • UIProcess/efl/WebColorPickerEfl.h: Copied from Source/WebKit2/UIProcess/efl/ViewClientEfl.h.

(WebKit::WebColorPickerEfl::create):
(WebKit::WebColorPickerEfl::~WebColorPickerEfl):

  • UIProcess/efl/WebColorPickerResultListenerProxy.cpp: Renamed from Source/WebKit2/UIProcess/WebColorPickerResultListenerProxy.cpp.

(WebKit::WebColorPickerResultListenerProxy::WebColorPickerResultListenerProxy):
(WebKit::WebColorPickerResultListenerProxy::~WebColorPickerResultListenerProxy):
(WebKit::WebColorPickerResultListenerProxy::invalidate):
(WebKit::WebColorPickerResultListenerProxy::setColor):

  • UIProcess/efl/WebColorPickerResultListenerProxy.h: Renamed from Source/WebKit2/UIProcess/WebColorPickerResultListenerProxy.h.

(WebKit::WebColorPickerResultListenerProxy::create):

  • UIProcess/efl/WebViewEfl.cpp:

(WebKit::WebViewEfl::initializeColorPickerClient):
(WebKit::WebViewEfl::createColorPicker):

  • UIProcess/efl/WebViewEfl.h:

(WebKit::WebViewEfl::colorPickerClient):

  • WebKit2.xcodeproj/project.pbxproj: Removed ColorPickerResultListener related files which are only for Efl from source list.
Location:
trunk/Source/WebKit2
Files:
1 added
18 edited
3 copied
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/CMakeLists.txt

    r164240 r164271  
    312312    UIProcess/WebBatteryProvider.cpp
    313313    UIProcess/WebColorPicker.cpp
    314     UIProcess/WebColorPickerResultListenerProxy.cpp
    315314    UIProcess/WebConnectionToWebProcess.cpp
    316315    UIProcess/WebContext.cpp
     
    364363    UIProcess/API/C/WKBatteryManager.cpp
    365364    UIProcess/API/C/WKBatteryStatus.cpp
    366     UIProcess/API/C/WKColorPickerResultListener.cpp
    367365    UIProcess/API/C/WKContext.cpp
    368366    UIProcess/API/C/WKCookieManager.cpp
  • trunk/Source/WebKit2/ChangeLog

    r164267 r164271  
     12014-02-17  Ryuan Choi  <ryuan.choi@samsung.com>
     2
     3        [EFL][WK2] Move and make WKColorPickerResultListener to EFL specific interface
     4        https://bugs.webkit.org/show_bug.cgi?id=119120
     5
     6        Reviewed by Gyuyoung Kim.
     7
     8        WKColorPickerResultListener and related files are only used in EFL since added.
     9        Indeed, it does not work since refactored common logic for ColorPicker in WebPageProxy.
     10
     11        This patch moved them to EFL specfic and refactor to work well.
     12
     13        * CMakeLists.txt: Moved WebColorPickerResultListenerProxy.cpp to PlatformEfl.cmake.
     14        * GNUmakefile.list.am: Removed ColorPickerResultListener related files which are only for Efl from source list.
     15        * PlatformEfl.cmake: Added ColorPickerResultListenerProxy related files and newly added files into source list.
     16        * UIProcess/API/APIUIClient.h:
     17        * UIProcess/API/C/WKPage.cpp:
     18        (WKPageSetPageUIClient):
     19        * UIProcess/API/C/efl/WKColorPickerResultListener.cpp: Renamed from Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.cpp.
     20        (WKColorPickerResultListenerGetTypeID):
     21        (WKColorPickerResultListenerSetColor):
     22        * UIProcess/API/C/efl/WKColorPickerResultListener.h: Renamed from Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.h.
     23        * UIProcess/API/C/efl/WKViewEfl.cpp: Introduced WKColorPickerClient and setter.
     24        (WKViewSetColorPickerClient):
     25        * UIProcess/API/C/efl/WKViewEfl.h:
     26        * UIProcess/API/efl/tests/test_ewk2_color_picker.cpp: Enabled test case for color picker.
     27        (TEST_F):
     28        * UIProcess/WebPageProxy.cpp: Removed unnecessary WebColorPickerResultListenerProxy dependency.
     29        * UIProcess/WebPageProxy.h: Ditto.
     30        * UIProcess/efl/PageUIClientEfl.cpp: Removed color picker callbacks of PageUIClient.
     31        (WebKit::PageUIClientEfl::PageUIClientEfl):
     32        * UIProcess/efl/PageUIClientEfl.h:
     33        * UIProcess/efl/ViewClientEfl.cpp: Registered callbacks of WKColorPickerClient.
     34        (WebKit::ViewClientEfl::showColorPicker):
     35        (WebKit::ViewClientEfl::endColorPicker):
     36        (WebKit::ViewClientEfl::ViewClientEfl):
     37        (WebKit::ViewClientEfl::~ViewClientEfl):
     38        * UIProcess/efl/ViewClientEfl.h:
     39        * UIProcess/efl/WebColorPickerClient.cpp: Copied from Source/WebKit2/UIProcess/efl/ViewClientEfl.h.
     40        (WebKit::WebColorPickerClient::showColorPicker):
     41        (WebKit::WebColorPickerClient::endPicker):
     42        * UIProcess/efl/WebColorPickerClient.h: Added.
     43        * UIProcess/efl/WebColorPickerEfl.cpp: Copied from Source/WebKit2/UIProcess/efl/ViewClientEfl.h.
     44        (WebKit::WebColorPickerEfl::WebColorPickerEfl):
     45        (WebKit::WebColorPickerEfl::endPicker):
     46        (WebKit::WebColorPickerEfl::showColorPicker):
     47        (WebKit::WebColorPickerEfl::setSelectedColor):
     48        (WebKit::WebColorPickerEfl::didChooseColor):
     49        * UIProcess/efl/WebColorPickerEfl.h: Copied from Source/WebKit2/UIProcess/efl/ViewClientEfl.h.
     50        (WebKit::WebColorPickerEfl::create):
     51        (WebKit::WebColorPickerEfl::~WebColorPickerEfl):
     52        * UIProcess/efl/WebColorPickerResultListenerProxy.cpp: Renamed from Source/WebKit2/UIProcess/WebColorPickerResultListenerProxy.cpp.
     53        (WebKit::WebColorPickerResultListenerProxy::WebColorPickerResultListenerProxy):
     54        (WebKit::WebColorPickerResultListenerProxy::~WebColorPickerResultListenerProxy):
     55        (WebKit::WebColorPickerResultListenerProxy::invalidate):
     56        (WebKit::WebColorPickerResultListenerProxy::setColor):
     57        * UIProcess/efl/WebColorPickerResultListenerProxy.h: Renamed from Source/WebKit2/UIProcess/WebColorPickerResultListenerProxy.h.
     58        (WebKit::WebColorPickerResultListenerProxy::create):
     59        * UIProcess/efl/WebViewEfl.cpp:
     60        (WebKit::WebViewEfl::initializeColorPickerClient):
     61        (WebKit::WebViewEfl::createColorPicker):
     62        * UIProcess/efl/WebViewEfl.h:
     63        (WebKit::WebViewEfl::colorPickerClient):
     64        * WebKit2.xcodeproj/project.pbxproj: Removed ColorPickerResultListener related files which are only for Efl from source list.
     65
    1662014-02-17  Sam Weinig  <sam@webkit.org>
    267
  • trunk/Source/WebKit2/GNUmakefile.list.am

    r163749 r164271  
    539539        Source/WebKit2/UIProcess/API/C/WKBatteryStatus.cpp \
    540540        Source/WebKit2/UIProcess/API/C/WKBatteryStatus.h \
    541         Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.cpp \
    542         Source/WebKit2/UIProcess/API/C/WKColorPickerResultListener.h \
    543541        Source/WebKit2/UIProcess/API/C/WKContext.cpp \
    544542        Source/WebKit2/UIProcess/API/C/WKContext.h \
     
    897895        Source/WebKit2/UIProcess/WebColorPicker.cpp \
    898896        Source/WebKit2/UIProcess/WebColorPicker.h \
    899         Source/WebKit2/UIProcess/WebColorPickerResultListenerProxy.cpp \
    900         Source/WebKit2/UIProcess/WebColorPickerResultListenerProxy.h \
    901897        Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp \
    902898        Source/WebKit2/UIProcess/WebConnectionToWebProcess.h \
  • trunk/Source/WebKit2/PlatformEfl.cmake

    r162536 r164271  
    5858    UIProcess/API/C/cairo/WKIconDatabaseCairo.cpp
    5959
     60    UIProcess/API/C/efl/WKColorPickerResultListener.cpp
    6061    UIProcess/API/C/efl/WKEventEfl.cpp
    6162    UIProcess/API/C/efl/WKPageEfl.cpp
     
    145146    UIProcess/efl/VibrationClientEfl.cpp
    146147    UIProcess/efl/ViewClientEfl.cpp
     148    UIProcess/efl/WebColorPickerClient.cpp
     149    UIProcess/efl/WebColorPickerEfl.cpp
     150    UIProcess/efl/WebColorPickerResultListenerProxy.cpp
    147151    UIProcess/efl/WebContextEfl.cpp
    148152    UIProcess/efl/WebContextMenuProxyEfl.cpp
  • trunk/Source/WebKit2/UIProcess/API/APIUIClient.h

    r163480 r164271  
    122122
    123123    virtual bool shouldInterruptJavaScript(WebKit::WebPageProxy*) { return false; }
    124 
    125 #if ENABLE(INPUT_TYPE_COLOR)
    126     virtual bool showColorPicker(WebKit::WebPageProxy*, const WTF::String&, WebKit::WebColorPickerResultListenerProxy*) { return false; }
    127     virtual bool hideColorPicker(WebKit::WebPageProxy*) { return false; }
    128 #endif
    129124};
    130125
  • trunk/Source/WebKit2/UIProcess/API/C/WKPage.cpp

    r164172 r164271  
    14611461            return m_client.shouldInterruptJavaScript(toAPI(page), m_client.base.clientInfo);
    14621462        }
    1463 
    1464 #if ENABLE(INPUT_TYPE_COLOR)
    1465         virtual bool showColorPicker(WebPageProxy* page, const String& initialColor, WebColorPickerResultListenerProxy* listener) override
    1466         {
    1467             if (!m_client.showColorPicker)
    1468                 return false;
    1469 
    1470             m_client.showColorPicker(toAPI(page), toAPI(initialColor.impl()), toAPI(listener), m_client.base.clientInfo);
    1471             return true;
    1472         }
    1473 
    1474         virtual bool hideColorPicker(WebPageProxy* page) override
    1475         {
    1476             if (!m_client.hideColorPicker)
    1477                 return false;
    1478 
    1479             m_client.hideColorPicker(toAPI(page), m_client.base.clientInfo);
    1480             return true;
    1481         }
    1482 #endif
    14831463    };
    14841464
  • trunk/Source/WebKit2/UIProcess/API/C/efl/WKViewEfl.cpp

    r159401 r164271  
    3434
    3535using namespace WebKit;
     36
     37void WKViewSetColorPickerClient(WKViewRef viewRef, const WKColorPickerClientBase* wkClient)
     38{
     39#if ENABLE(INPUT_TYPE_COLOR)
     40    static_cast<WebViewEfl*>(toImpl(viewRef))->initializeColorPickerClient(wkClient);
     41#else
     42    UNUSED_PARAM(viewRef);
     43    UNUSED_PARAM(wkClient);
     44#endif
     45}
    3646
    3747void WKViewPaintToCairoSurface(WKViewRef viewRef, cairo_surface_t* surface)
  • trunk/Source/WebKit2/UIProcess/API/C/efl/WKViewEfl.h

    r159401 r164271  
    3838#endif
    3939
     40typedef void (*WKShowColorPickerCallback)(WKViewRef view, WKStringRef initialColor, WKColorPickerResultListenerRef listener, const void* clientInfo);
     41typedef void (*WKHideColorPickerCallback)(WKViewRef view, const void* clientInfo);
     42
     43typedef struct WKColorPickerClientBase {
     44    int                                            version;
     45    const void *                                   clientInfo;
     46} WKColorPickerClientBase;
     47
     48typedef struct WKColorPickerClientV0 {
     49    WKColorPickerClientBase                        base;
     50    WKShowColorPickerCallback                      showColorPicker;
     51    WKHideColorPickerCallback                      endColorPicker;
     52} WKColorPickerClientV0;
     53
     54WK_EXPORT void WKViewSetColorPickerClient(WKViewRef page, const WKColorPickerClientBase* client);
     55
    4056WK_EXPORT void WKViewPaintToCairoSurface(WKViewRef, cairo_surface_t*);
    4157
  • trunk/Source/WebKit2/UIProcess/API/efl/tests/test_ewk2_color_picker.cpp

    r161948 r164271  
    125125};
    126126
    127 TEST_F(EWK2ColorPickerTest, DISABLED_ewk_color_picker_color_set)
     127TEST_F(EWK2ColorPickerTest, ewk_color_picker_color_set)
    128128{
    129129    Ewk_View_Smart_Class* api = ewkViewClass();
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r164254 r164271  
    5959#include "WebBackForwardListItem.h"
    6060#include "WebCertificateInfo.h"
    61 #include "WebColorPickerResultListenerProxy.h"
    6261#include "WebContext.h"
    6362#include "WebContextMenuProxy.h"
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r164254 r164271  
    145145class WebBackForwardList;
    146146class WebBackForwardListItem;
    147 class WebColorPickerResultListenerProxy;
    148147class WebContextMenuProxy;
    149148class WebEditCommandProxy;
     
    13461345#if ENABLE(INPUT_TYPE_COLOR)
    13471346    RefPtr<WebColorPicker> m_colorPicker;
    1348     RefPtr<WebColorPickerResultListenerProxy> m_colorPickerResultListener;
    13491347#endif
    13501348
  • trunk/Source/WebKit2/UIProcess/efl/PageUIClientEfl.cpp

    r160107 r164271  
    3636#include "ewk_window_features_private.h"
    3737#include <Ecore_Evas.h>
    38 #include <WebCore/Color.h>
    3938
    4039using namespace EwkViewCallbacks;
     
    8079    uiClient.runOpenPanel = runOpenPanel;
    8180    uiClient.createNewPage = createNewPage;
    82 #if ENABLE(INPUT_TYPE_COLOR)
    83     uiClient.showColorPicker = showColorPicker;
    84     uiClient.hideColorPicker = hideColorPicker;
    85 #endif
    8681
    8782    WKPageSetPageUIClient(pageRef, &uiClient.base);
     
    227222}
    228223
    229 #if ENABLE(INPUT_TYPE_COLOR)
    230 void PageUIClientEfl::showColorPicker(WKPageRef, WKStringRef initialColor, WKColorPickerResultListenerRef listener, const void* clientInfo)
    231 {
    232     PageUIClientEfl* pageUIClient = toPageUIClientEfl(clientInfo);
    233     WebCore::Color color = WebCore::Color(WebKit::toWTFString(initialColor));
    234     pageUIClient->m_view->requestColorPicker(listener, color);
    235 }
    236 
    237 void PageUIClientEfl::hideColorPicker(WKPageRef, const void* clientInfo)
    238 {
    239     PageUIClientEfl* pageUIClient = toPageUIClientEfl(clientInfo);
    240     pageUIClient->m_view->dismissColorPicker();
    241 }
    242 #endif
    243 
    244224void PageUIClientEfl::showPopupMenu(WKPageRef, WKPopupMenuListenerRef menuListenerRef, WKRect rect, WKPopupItemTextDirection textDirection, double pageScaleFactor, WKArrayRef itemsRef, int32_t selectedIndex, const void* clientInfo)
    245225{
  • trunk/Source/WebKit2/UIProcess/efl/PageUIClientEfl.h

    r159190 r164271  
    6464    static void runOpenPanel(WKPageRef, WKFrameRef, WKOpenPanelParametersRef, WKOpenPanelResultListenerRef, const void*);
    6565    static WKPageRef createNewPage(WKPageRef, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*);
    66 #if ENABLE(INPUT_TYPE_COLOR)
    67     static void showColorPicker(WKPageRef, WKStringRef initialColor, WKColorPickerResultListenerRef, const void*);
    68     static void hideColorPicker(WKPageRef, const void*);
    69 #endif
    7066
    7167    static void showPopupMenu(WKPageRef, WKPopupMenuListenerRef, WKRect, WKPopupItemTextDirection, double pageScaleFactor, WKArrayRef itemsRef, int32_t selectedIndex, const void* clientInfo);
  • trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.cpp

    r163079 r164271  
    159159#endif
    160160
     161#if ENABLE(INPUT_TYPE_COLOR)
     162void ViewClientEfl::showColorPicker(WKViewRef, WKStringRef colorString, WKColorPickerResultListenerRef listener, const void* clientInfo)
     163{
     164    WebCore::Color color = WebCore::Color(WebKit::toWTFString(colorString));
     165    toEwkView(clientInfo)->requestColorPicker(listener, color);
     166}
     167
     168void ViewClientEfl::endColorPicker(WKViewRef, const void* clientInfo)
     169{
     170    toEwkView(clientInfo)->dismissColorPicker();
     171}
     172#endif
     173
    161174ViewClientEfl::ViewClientEfl(EwkView* view)
    162175    : m_view(view)
     
    183196
    184197    WKViewSetViewClient(m_view->wkView(), &viewClient.base);
     198
     199#if ENABLE(INPUT_TYPE_COLOR)
     200    WKColorPickerClientV0 colorPickerClient;
     201    memset(&colorPickerClient, 0, sizeof(WKColorPickerClientV0));
     202    colorPickerClient.base.version = 0;
     203    colorPickerClient.base.clientInfo = this;
     204    colorPickerClient.showColorPicker = showColorPicker;
     205    colorPickerClient.endColorPicker = endColorPicker;
     206    WKViewSetColorPickerClient(m_view->wkView(), &colorPickerClient.base);
     207#endif
    185208}
    186209
     
    188211{
    189212    WKViewSetViewClient(m_view->wkView(), 0);
     213
     214#if ENABLE(INPUT_TYPE_COLOR)
     215    WKViewSetColorPickerClient(m_view->wkView(), 0);
     216#endif
    190217}
    191218
  • trunk/Source/WebKit2/UIProcess/efl/ViewClientEfl.h

    r159190 r164271  
    5454    static void doneWithTouchEvent(WKViewRef, WKTouchEventRef, bool, const void* clientInfo);
    5555#endif
     56#if ENABLE(INPUT_TYPE_COLOR)
     57    static void showColorPicker(WKViewRef, WKStringRef, WKColorPickerResultListenerRef, const void* clientInfo);
     58    static void endColorPicker(WKViewRef, const void* clientInfo);
     59#endif
    5660
    5761    EwkView* m_view;
  • trunk/Source/WebKit2/UIProcess/efl/WebColorPickerClient.cpp

    r164270 r164271  
    2424 */
    2525
    26 #ifndef ViewClientEfl_h
    27 #define ViewClientEfl_h
     26#include "config.h"
     27#include "WebColorPickerClient.h"
    2828
    29 #include <WebKit2/WKBase.h>
    30 #include <WebKit2/WKGeometry.h>
    31 
    32 class EwkView;
    33 
     29#if ENABLE(INPUT_TYPE_COLOR)
    3430namespace WebKit {
    3531
    36 class ViewClientEfl {
    37 public:
    38     explicit ViewClientEfl(EwkView*);
    39     ~ViewClientEfl();
     32void WebColorPickerClient::showColorPicker(WebView* webView, const String& color, WKColorPickerResultListenerRef listener)
     33{
     34    if (!m_client.showColorPicker)
     35        return;
    4036
    41 private:
    42     static EwkView* toEwkView(const void* clientInfo);
    43     static void viewNeedsDisplay(WKViewRef, WKRect area, const void* clientInfo);
    44     static void didChangeContentsSize(WKViewRef, WKSize, const void* clientInfo);
    45     static void webProcessCrashed(WKViewRef, WKURLRef, const void* clientInfo);
    46     static void webProcessDidRelaunch(WKViewRef, const void* clientInfo);
    47     static void didChangeContentsPosition(WKViewRef, WKPoint, const void* clientInfo);
    48     static void didRenderFrame(WKViewRef, WKSize, WKRect, const void* clientInfo);
    49     static void didCompletePageTransition(WKViewRef, const void* clientInfo);
    50     static void didChangeViewportAttributes(WKViewRef, WKViewportAttributesRef, const void* clientInfo);
    51     static void didChangeTooltip(WKViewRef, WKStringRef, const void* clientInfo);
    52     static void didFindZoomableArea(WKViewRef, WKPoint, WKRect, const void* clientInfo);
    53 #if ENABLE(TOUCH_EVENTS)
    54     static void doneWithTouchEvent(WKViewRef, WKTouchEventRef, bool, const void* clientInfo);
     37    m_client.showColorPicker(toAPI(webView), toAPI(color.impl()), listener, m_client.base.clientInfo);
     38}
     39
     40void WebColorPickerClient::endPicker(WebView* webView)
     41{
     42    if (!m_client.endColorPicker)
     43        return;
     44
     45    m_client.endColorPicker(toAPI(webView), m_client.base.clientInfo);
     46}
     47
     48}
    5549#endif
    56 
    57     EwkView* m_view;
    58 };
    59 
    60 } // namespace WebKit
    61 
    62 #endif // ViewClientEfl_h
  • trunk/Source/WebKit2/UIProcess/efl/WebColorPickerEfl.cpp

    r164270 r164271  
    2424 */
    2525
    26 #ifndef ViewClientEfl_h
    27 #define ViewClientEfl_h
     26#include "config.h"
     27#include "WebColorPickerEfl.h"
    2828
    29 #include <WebKit2/WKBase.h>
    30 #include <WebKit2/WKGeometry.h>
    31 
    32 class EwkView;
     29#if ENABLE(INPUT_TYPE_COLOR)
     30#include "NotImplemented.h"
     31#include "ewk_color_picker_private.h"
    3332
    3433namespace WebKit {
    3534
    36 class ViewClientEfl {
    37 public:
    38     explicit ViewClientEfl(EwkView*);
    39     ~ViewClientEfl();
     35WebColorPickerEfl::WebColorPickerEfl(WebViewEfl* webView, WebColorPicker::Client* client, const WebCore::Color&)
     36    : WebColorPicker(client)
     37    , m_webView(webView)
     38{
     39    ASSERT(m_webView);
     40    m_colorPickerResultListener = WebColorPickerResultListenerProxy::create(this);
     41}
    4042
    41 private:
    42     static EwkView* toEwkView(const void* clientInfo);
    43     static void viewNeedsDisplay(WKViewRef, WKRect area, const void* clientInfo);
    44     static void didChangeContentsSize(WKViewRef, WKSize, const void* clientInfo);
    45     static void webProcessCrashed(WKViewRef, WKURLRef, const void* clientInfo);
    46     static void webProcessDidRelaunch(WKViewRef, const void* clientInfo);
    47     static void didChangeContentsPosition(WKViewRef, WKPoint, const void* clientInfo);
    48     static void didRenderFrame(WKViewRef, WKSize, WKRect, const void* clientInfo);
    49     static void didCompletePageTransition(WKViewRef, const void* clientInfo);
    50     static void didChangeViewportAttributes(WKViewRef, WKViewportAttributesRef, const void* clientInfo);
    51     static void didChangeTooltip(WKViewRef, WKStringRef, const void* clientInfo);
    52     static void didFindZoomableArea(WKViewRef, WKPoint, WKRect, const void* clientInfo);
    53 #if ENABLE(TOUCH_EVENTS)
    54     static void doneWithTouchEvent(WKViewRef, WKTouchEventRef, bool, const void* clientInfo);
    55 #endif
     43void WebColorPickerEfl::endPicker()
     44{
     45    m_webView->colorPickerClient().endPicker(m_webView);
     46}
    5647
    57     EwkView* m_view;
    58 };
     48void WebColorPickerEfl::showColorPicker(const WebCore::Color& color)
     49{
     50    m_webView->colorPickerClient().showColorPicker(m_webView, color.serialized(), toAPI(m_colorPickerResultListener.get()));
     51}
     52
     53void WebColorPickerEfl::setSelectedColor(const WebCore::Color&)
     54{
     55    notImplemented();
     56}
     57
     58void WebColorPickerEfl::didChooseColor(const WebCore::Color& color)
     59{
     60    if (!m_client)
     61        return;
     62
     63    m_client->didChooseColor(color);
     64    m_client->didEndColorPicker();
     65}
    5966
    6067} // namespace WebKit
    61 
    62 #endif // ViewClientEfl_h
     68#endif
  • trunk/Source/WebKit2/UIProcess/efl/WebColorPickerEfl.h

    r164270 r164271  
    2424 */
    2525
    26 #ifndef ViewClientEfl_h
    27 #define ViewClientEfl_h
     26#ifndef WebColorPickerEfl_h
     27#define WebColorPickerEfl_h
    2828
    29 #include <WebKit2/WKBase.h>
    30 #include <WebKit2/WKGeometry.h>
    31 
    32 class EwkView;
     29#if ENABLE(INPUT_TYPE_COLOR)
     30#include "WebColorPicker.h"
     31#include "WebColorPickerResultListenerProxy.h"
     32#include "WebViewEfl.h"
    3333
    3434namespace WebKit {
    3535
    36 class ViewClientEfl {
     36class WebColorPickerEfl : public WebColorPicker {
    3737public:
    38     explicit ViewClientEfl(EwkView*);
    39     ~ViewClientEfl();
     38    static PassRefPtr<WebColorPickerEfl> create(WebViewEfl* webView, WebColorPicker::Client* client, const WebCore::Color& initialColor)
     39    {
     40        return adoptRef(new WebColorPickerEfl(webView, client, initialColor));
     41    }
     42    ~WebColorPickerEfl() { }
     43
     44    virtual void endPicker() override;
     45    virtual void setSelectedColor(const WebCore::Color&) override;
     46    virtual void showColorPicker(const WebCore::Color&) override;
     47
     48    void didChooseColor(const WebCore::Color&);
    4049
    4150private:
    42     static EwkView* toEwkView(const void* clientInfo);
    43     static void viewNeedsDisplay(WKViewRef, WKRect area, const void* clientInfo);
    44     static void didChangeContentsSize(WKViewRef, WKSize, const void* clientInfo);
    45     static void webProcessCrashed(WKViewRef, WKURLRef, const void* clientInfo);
    46     static void webProcessDidRelaunch(WKViewRef, const void* clientInfo);
    47     static void didChangeContentsPosition(WKViewRef, WKPoint, const void* clientInfo);
    48     static void didRenderFrame(WKViewRef, WKSize, WKRect, const void* clientInfo);
    49     static void didCompletePageTransition(WKViewRef, const void* clientInfo);
    50     static void didChangeViewportAttributes(WKViewRef, WKViewportAttributesRef, const void* clientInfo);
    51     static void didChangeTooltip(WKViewRef, WKStringRef, const void* clientInfo);
    52     static void didFindZoomableArea(WKViewRef, WKPoint, WKRect, const void* clientInfo);
    53 #if ENABLE(TOUCH_EVENTS)
    54     static void doneWithTouchEvent(WKViewRef, WKTouchEventRef, bool, const void* clientInfo);
     51    WebColorPickerEfl(WebViewEfl*, WebColorPicker::Client*, const WebCore::Color&);
     52
     53    WebViewEfl* m_webView;
     54    RefPtr<WebColorPickerResultListenerProxy> m_colorPickerResultListener;
     55};
     56
     57}
    5558#endif
    5659
    57     EwkView* m_view;
    58 };
    59 
    60 } // namespace WebKit
    61 
    62 #endif // ViewClientEfl_h
     60#endif // WebColorPickerEfl_h
  • trunk/Source/WebKit2/UIProcess/efl/WebColorPickerResultListenerProxy.cpp

    r164270 r164271  
    11/*
    2  * Copyright (C) 2012 Samsung Electronics. All rights reserved.
     2 * Copyright (C) 2012-2014 Samsung Electronics. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2828
    2929#if ENABLE(INPUT_TYPE_COLOR)
    30 
    31 #include "WebPageProxy.h"
     30#include "WebColorPickerEfl.h"
     31#include <WebCore/Color.h>
    3232
    3333namespace WebKit {
    3434
    35 WebColorPickerResultListenerProxy::WebColorPickerResultListenerProxy(WebPageProxy* page)
    36     : m_page(page)
     35WebColorPickerResultListenerProxy::WebColorPickerResultListenerProxy(WebColorPickerEfl* colorPicker)
     36    : m_colorPicker(colorPicker)
    3737{
     38    ASSERT(m_colorPicker);
    3839}
    3940
     
    4445void WebColorPickerResultListenerProxy::invalidate()
    4546{
    46     m_page = 0;
     47    m_colorPicker = 0;
    4748}
    4849
    4950void WebColorPickerResultListenerProxy::setColor(const String& color)
    5051{
    51     if (!m_page)
     52    if (!m_colorPicker)
    5253        return;
    5354
    54     m_page->setColorPickerColor(WebCore::Color(color));
    55     m_page->endColorPicker();
     55    m_colorPicker->didChooseColor(WebCore::Color(color));
    5656}
    5757
  • trunk/Source/WebKit2/UIProcess/efl/WebColorPickerResultListenerProxy.h

    r164270 r164271  
    3636namespace WebKit {
    3737
    38 class WebPageProxy;
     38class WebColorPickerEfl;
    3939
    4040class WebColorPickerResultListenerProxy : public API::ObjectImpl<API::Object::Type::ColorPickerResultListener> {
    4141public:
    42     static PassRefPtr<WebColorPickerResultListenerProxy> create(WebPageProxy* page)
     42    static PassRefPtr<WebColorPickerResultListenerProxy> create(WebColorPickerEfl* colorPicker)
    4343    {
    44         return adoptRef(new WebColorPickerResultListenerProxy(page));
     44        return adoptRef(new WebColorPickerResultListenerProxy(colorPicker));
    4545    }
    4646
     
    5151
    5252private:
    53     explicit WebColorPickerResultListenerProxy(WebPageProxy*);
     53    explicit WebColorPickerResultListenerProxy(WebColorPickerEfl*);
    5454
    55     RefPtr<WebPageProxy> m_page;
     55    WebColorPickerEfl* m_colorPicker;
    5656};
    5757
  • trunk/Source/WebKit2/UIProcess/efl/WebViewEfl.cpp

    r160432 r164271  
    4343#if ENABLE(TOUCH_EVENTS)
    4444#include "EwkTouchEvent.h"
     45#endif
     46
     47#if ENABLE(INPUT_TYPE_COLOR)
     48#include "WebColorPickerEfl.h"
    4549#endif
    4650
     
    179183#endif // ENABLE(FULLSCREEN_API)
    180184
     185#if ENABLE(INPUT_TYPE_COLOR)
     186void WebViewEfl::initializeColorPickerClient(const WKColorPickerClientBase* client)
     187{
     188    m_colorPickerClient.initialize(client);
     189}
     190
     191PassRefPtr<WebColorPicker> WebViewEfl::createColorPicker(WebPageProxy* page, const WebCore::Color& color, const WebCore::IntRect&)
     192{
     193    return WebColorPickerEfl::create(this, page, color);
     194}
     195#endif
     196
    181197} // namespace WebKit
  • trunk/Source/WebKit2/UIProcess/efl/WebViewEfl.h

    r162158 r164271  
    2727#define WebViewEfl_h
    2828
     29#include "WebColorPickerClient.h"
    2930#include "WebView.h"
    3031
     
    5253    void sendMouseEvent(const Evas_Event_Mouse_Up*);
    5354    void sendMouseEvent(const Evas_Event_Mouse_Move*);
     55
     56#if ENABLE(INPUT_TYPE_COLOR)
     57    void initializeColorPickerClient(const WKColorPickerClientBase*);
     58
     59    WebColorPickerClient& colorPickerClient() { return m_colorPickerClient; }
     60    virtual PassRefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color&, const WebCore::IntRect&) override;
     61#endif
    5462
    5563private:
     
    7987    bool m_hasRequestedFullScreen;
    8088
     89#if ENABLE(INPUT_TYPE_COLOR)
     90    WebColorPickerClient m_colorPickerClient;
     91#endif
     92
    8193    friend class WebView;
    8294};
  • trunk/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

    r164258 r164271  
    14421442                ED82A7F2128C6FAF004477B3 /* WKBundlePageOverlay.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A22F0FF1289FCD90085E74F /* WKBundlePageOverlay.h */; settings = {ATTRIBUTES = (Private, ); }; };
    14431443                EDCA71B7128DDA8C00201B26 /* WKBundlePageOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A22F1001289FCD90085E74F /* WKBundlePageOverlay.cpp */; };
    1444                 F036978515F4BE6B00C3A80E /* WKColorPickerResultListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F036978315F4BE6B00C3A80E /* WKColorPickerResultListener.cpp */; };
    1445                 F036978615F4BE6B00C3A80E /* WKColorPickerResultListener.h in Headers */ = {isa = PBXBuildFile; fileRef = F036978415F4BE6B00C3A80E /* WKColorPickerResultListener.h */; };
    14461444                F036978815F4BF0500C3A80E /* WebColorPicker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F036978715F4BF0500C3A80E /* WebColorPicker.cpp */; };
    14471445                F036978B15F4BF1300C3A80E /* WebColorPickerResultListenerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F036978915F4BF1300C3A80E /* WebColorPickerResultListenerProxy.cpp */; };
     
    32333231                E1EE53DC11F8CF9F00CCBEE4 /* InjectedBundlePageEditorClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InjectedBundlePageEditorClient.h; sourceTree = "<group>"; };
    32343232                E1EE53E611F8CFFB00CCBEE4 /* InjectedBundlePageEditorClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InjectedBundlePageEditorClient.cpp; sourceTree = "<group>"; };
    3235                 F036978315F4BE6B00C3A80E /* WKColorPickerResultListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKColorPickerResultListener.cpp; sourceTree = "<group>"; };
    3236                 F036978415F4BE6B00C3A80E /* WKColorPickerResultListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKColorPickerResultListener.h; sourceTree = "<group>"; };
    32373233                F036978715F4BF0500C3A80E /* WebColorPicker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebColorPicker.cpp; sourceTree = "<group>"; };
    3238                 F036978915F4BF1300C3A80E /* WebColorPickerResultListenerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebColorPickerResultListenerProxy.cpp; sourceTree = "<group>"; };
    3239                 F036978A15F4BF1300C3A80E /* WebColorPickerResultListenerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebColorPickerResultListenerProxy.h; sourceTree = "<group>"; };
    32403234                F6113E24126CE1820057D0A7 /* WebUserContentURLPattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebUserContentURLPattern.h; sourceTree = "<group>"; };
    32413235                F6113E26126CE19B0057D0A7 /* WKUserContentURLPattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKUserContentURLPattern.cpp; sourceTree = "<group>"; };
     
    50795073                                F036978715F4BF0500C3A80E /* WebColorPicker.cpp */,
    50805074                                3F87B9BF158940D80090FF62 /* WebColorPicker.h */,
    5081                                 F036978915F4BF1300C3A80E /* WebColorPickerResultListenerProxy.cpp */,
    5082                                 F036978A15F4BF1300C3A80E /* WebColorPickerResultListenerProxy.h */,
    50835075                                BC4A62A514744EC6006C681A /* WebConnectionToWebProcess.cpp */,
    50845076                                BC4A62A614744EC6006C681A /* WebConnectionToWebProcess.h */,
     
    52055197                                BC646C1611DD399F006455B0 /* WKBackForwardListRef.cpp */,
    52065198                                BC646C1711DD399F006455B0 /* WKBackForwardListRef.h */,
    5207                                 F036978315F4BE6B00C3A80E /* WKColorPickerResultListener.cpp */,
    5208                                 F036978415F4BE6B00C3A80E /* WKColorPickerResultListener.h */,
    52095199                                BCB9E24A1120E15C00A137E0 /* WKContext.cpp */,
    52105200                                BCB9E2491120E15C00A137E0 /* WKContext.h */,
     
    67966786                                BC4075F6124FF0270068F20A /* WKCertificateInfo.h in Headers */,
    67976787                                BC407627124FF0400068F20A /* WKCertificateInfoMac.h in Headers */,
    6798                                 F036978615F4BE6B00C3A80E /* WKColorPickerResultListener.h in Headers */,
    67996788                                372CAF0B1833FD910040AC27 /* WKNSError.h in Headers */,
    68006789                                BC5C75C814954DA600BC4775 /* WKConnectionInternal.h in Headers */,
     
    79737962                                3F87B9BD158940120090FF62 /* WebColorChooser.cpp in Sources */,
    79747963                                F036978815F4BF0500C3A80E /* WebColorPicker.cpp in Sources */,
    7975                                 F036978B15F4BF1300C3A80E /* WebColorPickerResultListenerProxy.cpp in Sources */,
    79767964                                BC4A628F147312BE006C681A /* WebConnection.cpp in Sources */,
    79777965                                BC4A6291147312BE006C681A /* WebConnectionClient.cpp in Sources */,
     
    82008188                                BC407628124FF0400068F20A /* WKCertificateInfoMac.mm in Sources */,
    82018189                                515E7727183DD6F60007203F /* AsyncRequest.cpp in Sources */,
    8202                                 F036978515F4BE6B00C3A80E /* WKColorPickerResultListener.cpp in Sources */,
    82038190                                BCA284D61492F2C7001F9042 /* WKConnection.mm in Sources */,
    82048191                                BC4A6296147313A0006C681A /* WKConnectionRef.cpp in Sources */,
Note: See TracChangeset for help on using the changeset viewer.