[WK2] Color chooser API missing
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2012 00:43:59 +0000 (00:43 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 21 Jun 2012 00:43:59 +0000 (00:43 +0000)
https://bugs.webkit.org/show_bug.cgi?id=87495

Patch by Thiago Marcos P. Santos <thiago.santos@intel.com> on 2012-06-20
Reviewed by Andreas Kling.

Added ColorChooser API to WebKit2. This API allows the
embedder to define a custom color picker for <input type="color">.

Only one ColorChooser can be active for a page at a time. Although
the implementation doesn't not assume a modal dialog, no other
color chooser will be created until the active one is closed.

Also added stubs for all platforms, so it wont break the build when
enabling color chooser, even though they don't have the backend
implemented yet.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* UIProcess/API/efl/PageClientImpl.cpp:
(WebKit):
(WebKit::PageClientImpl::createColorChooserProxy):
* UIProcess/API/efl/PageClientImpl.h:
(PageClientImpl):
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit):
(WebKit::PageClientImpl::createColorChooserProxy):
* UIProcess/API/gtk/PageClientImpl.h:
(PageClientImpl):
* UIProcess/API/mac/PageClientImpl.h:
(PageClientImpl):
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit):
(WebKit::PageClientImpl::createColorChooserProxy):
* UIProcess/PageClient.h:
(WebKit):
(PageClient):
* UIProcess/WebColorChooserProxy.h: Added.
(WebCore):
(WebKit):
(WebColorChooserProxy):
(Client):
(WebKit::WebColorChooserProxy::Client::~Client):
(WebKit::WebColorChooserProxy::~WebColorChooserProxy):
(WebKit::WebColorChooserProxy::invalidate):
(WebKit::WebColorChooserProxy::WebColorChooserProxy):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
(WebKit):
(WebKit::WebPageProxy::showColorChooser):
(WebKit::WebPageProxy::setColorChooserColor):
(WebKit::WebPageProxy::endColorChooser):
(WebKit::WebPageProxy::didChooseColor):
(WebKit::WebPageProxy::didEndColorChooser):
(WebKit::WebPageProxy::processDidCrash):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/WebPageProxy.messages.in:
* UIProcess/qt/QtPageClient.cpp:
(WebKit):
(WebKit::QtPageClient::createColorChooserProxy):
* UIProcess/qt/QtPageClient.h:
(QtPageClient):
* UIProcess/win/WebView.cpp:
(WebKit):
(WebKit::WebView::createColorChooserProxy):
* UIProcess/win/WebView.h:
(WebView):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::createColorChooser):
* WebProcess/WebCoreSupport/WebColorChooser.cpp: Added.
(WebKit):
(WebKit::WebColorChooser::WebColorChooser):
(WebKit::WebColorChooser::~WebColorChooser):
(WebKit::WebColorChooser::didChooseColor):
(WebKit::WebColorChooser::didEndChooser):
(WebKit::WebColorChooser::disconnectFromPage):
(WebKit::WebColorChooser::setSelectedColor):
(WebKit::WebColorChooser::endChooser):
* WebProcess/WebCoreSupport/WebColorChooser.h: Added.
(WebCore):
(WebKit):
(WebColorChooser):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::close):
(WebKit):
(WebKit::WebPage::setActiveColorChooser):
(WebKit::WebPage::didEndColorChooser):
(WebKit::WebPage::didChooseColor):
* WebProcess/WebPage/WebPage.h:
(WebKit):
(WebPage):
(WebKit::WebPage::activeColorChooser):
* WebProcess/WebPage/WebPage.messages.in:
* win/WebKit2.vcproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@120890 268f45cc-cd09-0410-ab3c-d52691b4dbfc

27 files changed:
Source/WebKit2/CMakeLists.txt
Source/WebKit2/ChangeLog
Source/WebKit2/GNUmakefile.list.am
Source/WebKit2/Target.pri
Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/efl/PageClientImpl.h
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.cpp
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
Source/WebKit2/UIProcess/API/mac/PageClientImpl.h
Source/WebKit2/UIProcess/API/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebColorChooserProxy.h [new file with mode: 0644]
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/qt/QtPageClient.cpp
Source/WebKit2/UIProcess/qt/QtPageClient.h
Source/WebKit2/UIProcess/win/WebView.cpp
Source/WebKit2/UIProcess/win/WebView.h
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.h [new file with mode: 0644]
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Source/WebKit2/win/WebKit2.vcproj

index 45dbe24..b8c6033 100644 (file)
@@ -401,6 +401,7 @@ SET(WebKit2_SOURCES
     WebProcess/ResourceCache/WebResourceCacheManager.cpp
 
     WebProcess/WebCoreSupport/WebChromeClient.cpp
+    WebProcess/WebCoreSupport/WebColorChooser.cpp
     WebProcess/WebCoreSupport/WebContextMenuClient.cpp
     WebProcess/WebCoreSupport/WebDatabaseManager.cpp
     WebProcess/WebCoreSupport/WebDragClient.cpp
index 257f44a..679cfe1 100644 (file)
@@ -1,3 +1,103 @@
+2012-06-20  Thiago Marcos P. Santos  <thiago.santos@intel.com>
+
+        [WK2] Color chooser API missing
+        https://bugs.webkit.org/show_bug.cgi?id=87495
+
+        Reviewed by Andreas Kling.
+
+        Added ColorChooser API to WebKit2. This API allows the
+        embedder to define a custom color picker for <input type="color">.
+
+        Only one ColorChooser can be active for a page at a time. Although
+        the implementation doesn't not assume a modal dialog, no other
+        color chooser will be created until the active one is closed.
+
+        Also added stubs for all platforms, so it wont break the build when
+        enabling color chooser, even though they don't have the backend
+        implemented yet.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * UIProcess/API/efl/PageClientImpl.cpp:
+        (WebKit):
+        (WebKit::PageClientImpl::createColorChooserProxy):
+        * UIProcess/API/efl/PageClientImpl.h:
+        (PageClientImpl):
+        * UIProcess/API/gtk/PageClientImpl.cpp:
+        (WebKit):
+        (WebKit::PageClientImpl::createColorChooserProxy):
+        * UIProcess/API/gtk/PageClientImpl.h:
+        (PageClientImpl):
+        * UIProcess/API/mac/PageClientImpl.h:
+        (PageClientImpl):
+        * UIProcess/API/mac/PageClientImpl.mm:
+        (WebKit):
+        (WebKit::PageClientImpl::createColorChooserProxy):
+        * UIProcess/PageClient.h:
+        (WebKit):
+        (PageClient):
+        * UIProcess/WebColorChooserProxy.h: Added.
+        (WebCore):
+        (WebKit):
+        (WebColorChooserProxy):
+        (Client):
+        (WebKit::WebColorChooserProxy::Client::~Client):
+        (WebKit::WebColorChooserProxy::~WebColorChooserProxy):
+        (WebKit::WebColorChooserProxy::invalidate):
+        (WebKit::WebColorChooserProxy::WebColorChooserProxy):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::close):
+        (WebKit):
+        (WebKit::WebPageProxy::showColorChooser):
+        (WebKit::WebPageProxy::setColorChooserColor):
+        (WebKit::WebPageProxy::endColorChooser):
+        (WebKit::WebPageProxy::didChooseColor):
+        (WebKit::WebPageProxy::didEndColorChooser):
+        (WebKit::WebPageProxy::processDidCrash):
+        * UIProcess/WebPageProxy.h:
+        (WebPageProxy):
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/qt/QtPageClient.cpp:
+        (WebKit):
+        (WebKit::QtPageClient::createColorChooserProxy):
+        * UIProcess/qt/QtPageClient.h:
+        (QtPageClient):
+        * UIProcess/win/WebView.cpp:
+        (WebKit):
+        (WebKit::WebView::createColorChooserProxy):
+        * UIProcess/win/WebView.h:
+        (WebView):
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::createColorChooser):
+        * WebProcess/WebCoreSupport/WebColorChooser.cpp: Added.
+        (WebKit):
+        (WebKit::WebColorChooser::WebColorChooser):
+        (WebKit::WebColorChooser::~WebColorChooser):
+        (WebKit::WebColorChooser::didChooseColor):
+        (WebKit::WebColorChooser::didEndChooser):
+        (WebKit::WebColorChooser::disconnectFromPage):
+        (WebKit::WebColorChooser::setSelectedColor):
+        (WebKit::WebColorChooser::endChooser):
+        * WebProcess/WebCoreSupport/WebColorChooser.h: Added.
+        (WebCore):
+        (WebKit):
+        (WebColorChooser):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        (WebKit::WebPage::close):
+        (WebKit):
+        (WebKit::WebPage::setActiveColorChooser):
+        (WebKit::WebPage::didEndColorChooser):
+        (WebKit::WebPage::didChooseColor):
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit):
+        (WebPage):
+        (WebKit::WebPage::activeColorChooser):
+        * WebProcess/WebPage/WebPage.messages.in:
+        * win/WebKit2.vcproj:
+
 2012-06-20  Brady Eidson  <beidson@apple.com>
 
         <rdar://problem/11653784> and https://bugs.webkit.org/show_bug.cgi?id=89590
index 3523918..2342304 100644 (file)
@@ -756,6 +756,7 @@ webkit2_sources += \
        Source/WebKit2/UIProcess/WebApplicationCacheManagerProxy.cpp \
        Source/WebKit2/UIProcess/WebBackForwardList.cpp \
        Source/WebKit2/UIProcess/WebBackForwardList.h \
+       Source/WebKit2/UIProcess/WebColorChooserProxy.h \
        Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp \
        Source/WebKit2/UIProcess/WebConnectionToWebProcess.h \
        Source/WebKit2/UIProcess/WebContext.cpp \
@@ -999,6 +1000,8 @@ webkit2_sources += \
        Source/WebKit2/WebProcess/WebCoreSupport/WebAlternativeTextClient.h \
        Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp \
        Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h \
+       Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.cpp \
+       Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.h \
        Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.cpp \
        Source/WebKit2/WebProcess/WebCoreSupport/WebContextMenuClient.h \
        Source/WebKit2/WebProcess/WebCoreSupport/WebDatabaseManager.cpp \
index 9e5bc4e..aa08e3c 100644 (file)
@@ -229,6 +229,7 @@ HEADERS += \
     UIProcess/VisitedLinkProvider.h \
     UIProcess/WebApplicationCacheManagerProxy.h \
     UIProcess/WebBackForwardList.h \
+    UIProcess/WebColorChooserProxy.h \
     UIProcess/WebConnectionToWebProcess.h \
     UIProcess/WebContext.h \
     UIProcess/WebContextConnectionClient.h \
@@ -345,6 +346,7 @@ HEADERS += \
     WebProcess/Plugins/PluginProcessConnection.h \
     WebProcess/Plugins/PluginProcessConnectionManager.h \
     WebProcess/WebCoreSupport/WebChromeClient.h \
+    WebProcess/WebCoreSupport/WebColorChooser.h \
     WebProcess/WebCoreSupport/WebContextMenuClient.h \
     WebProcess/WebCoreSupport/WebDatabaseManager.h \
     WebProcess/WebCoreSupport/WebDragClient.h \
@@ -711,6 +713,7 @@ SOURCES += \
     WebProcess/Plugins/PluginProcessConnection.cpp \
     WebProcess/Plugins/PluginProcessConnectionManager.cpp \
     WebProcess/WebCoreSupport/WebChromeClient.cpp \
+    WebProcess/WebCoreSupport/WebColorChooser.cpp \
     WebProcess/WebCoreSupport/WebContextMenuClient.cpp \
     WebProcess/WebCoreSupport/WebDatabaseManager.cpp \
     WebProcess/WebCoreSupport/WebDragClient.cpp \
index 567548f..e69f87d 100644 (file)
@@ -205,6 +205,14 @@ PassRefPtr<WebContextMenuProxy> PageClientImpl::createContextMenuProxy(WebPagePr
     return 0;
 }
 
+#if ENABLE(INPUT_TYPE_COLOR)
+PassRefPtr<WebColorChooserProxy> PageClientImpl::createColorChooserProxy(WebPageProxy*, const WebCore::Color&)
+{
+    notImplemented();
+    return 0;
+}
+#endif
+
 void PageClientImpl::setFindIndicator(PassRefPtr<FindIndicator>, bool, bool)
 {
     notImplemented();
index a4dcd93..427ef52 100644 (file)
@@ -84,6 +84,10 @@ private:
     virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
     virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*);
 
+#if ENABLE(INPUT_TYPE_COLOR)
+    virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& initialColor);
+#endif
+
     virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool, bool);
 #if USE(ACCELERATED_COMPOSITING)
     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
index 8fbfe73..8ecd480 100644 (file)
@@ -229,6 +229,14 @@ PassRefPtr<WebContextMenuProxy> PageClientImpl::createContextMenuProxy(WebPagePr
     return WebContextMenuProxyGtk::create(m_viewWidget, page);
 }
 
+#if ENABLE(INPUT_TYPE_COLOR)
+PassRefPtr<WebColorChooserProxy> PageClientImpl::createColorChooserProxy(WebPageProxy*, const WebCore::Color&)
+{
+    notImplemented();
+    return 0;
+}
+#endif
+
 void PageClientImpl::setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate)
 {
     notImplemented();
index 54ad99f..72fc345 100644 (file)
@@ -81,6 +81,9 @@ private:
     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled);
     virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
     virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*);
+#if ENABLE(INPUT_TYPE_COLOR)
+    virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& intialColor);
+#endif
     virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate);
     virtual void didChangeScrollbarsForMainFrame() const;
     virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>& updateRects);
index ac074e8..8af6ff4 100644 (file)
@@ -94,6 +94,10 @@ private:
     virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
     virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*);
 
+#if ENABLE(INPUT_TYPE_COLOR)
+    virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& initialColor);
+#endif
+
     void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate);
 
     virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
index 8d0913e..3bd7020 100644 (file)
@@ -360,6 +360,14 @@ PassRefPtr<WebContextMenuProxy> PageClientImpl::createContextMenuProxy(WebPagePr
     return WebContextMenuProxyMac::create(m_wkView, page);
 }
 
+#if ENABLE(INPUT_TYPE_COLOR)
+PassRefPtr<WebColorChooserProxy> PageClientImpl::createColorChooserProxy(WebPageProxy*, const WebCore::Color&)
+{
+    notImplemented();
+    return 0;
+}
+#endif
+
 void PageClientImpl::setFindIndicator(PassRefPtr<FindIndicator> findIndicator, bool fadeOut, bool animate)
 {
     [m_wkView _setFindIndicator:findIndicator fadeOut:fadeOut animate:animate];
index 7401fd7..fc5d747 100644 (file)
@@ -27,6 +27,7 @@
 #define PageClient_h
 
 #include "ShareableBitmap.h"
+#include "WebColorChooserProxy.h"
 #include "WebPageProxy.h"
 #include "WebPopupMenuProxy.h"
 #include <WebCore/AlternativeTextClient.h>
@@ -61,6 +62,9 @@ class WebGestureEvent;
 class WebContextMenuProxy;
 class WebEditCommandProxy;
 class WebPopupMenuProxy;
+#if ENABLE(INPUT_TYPE_COLOR)
+class WebColorChooserProxy;
+#endif
 
 #if PLATFORM(WIN)
 struct WindowGeometry;
@@ -169,6 +173,10 @@ public:
     virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) = 0;
     virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*) = 0;
 
+#if ENABLE(INPUT_TYPE_COLOR)
+    virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& initialColor) = 0;
+#endif
+
     virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate) = 0;
 #if PLATFORM(WIN)
     virtual void didInstallOrUninstallPageOverlay(bool) = 0;
diff --git a/Source/WebKit2/UIProcess/WebColorChooserProxy.h b/Source/WebKit2/UIProcess/WebColorChooserProxy.h
new file mode 100644 (file)
index 0000000..7906c10
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. 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. AND ITS CONTRIBUTORS ``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 ITS 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 WebColorChooserProxy_h
+#define WebColorChooserProxy_h
+
+#if ENABLE(INPUT_TYPE_COLOR)
+
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+class Color;
+}
+
+namespace WebKit {
+
+class WebPageProxy;
+
+class WebColorChooserProxy : public RefCounted<WebColorChooserProxy> {
+public:
+    class Client {
+    protected:
+        virtual ~Client() { }
+
+    public:
+        virtual void didChooseColor(const WebCore::Color&) = 0;
+        virtual void didEndColorChooser() = 0;
+    };
+    virtual ~WebColorChooserProxy() { }
+
+    void invalidate() { m_client = 0; }
+
+    virtual void endChooser() = 0;
+    virtual void setSelectedColor(const WebCore::Color&) = 0;
+
+protected:
+    WebColorChooserProxy(Client* client)
+        : m_client(client)
+    {
+    }
+
+    Client* m_client;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(INPUT_TYPE_COLOR)
+
+#endif // WebColorChooserProxy_h
index 74b3078..578e08a 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -403,6 +404,13 @@ void WebPageProxy::close()
         m_openPanelResultListener = 0;
     }
 
+#if ENABLE(INPUT_TYPE_COLOR)
+    if (m_colorChooser) {
+        m_colorChooser->invalidate();
+        m_colorChooser = nullptr;
+    }
+#endif
+
 #if ENABLE(GEOLOCATION)
     m_geolocationPermissionRequestManager.invalidateRequests();
 #endif
@@ -2641,6 +2649,50 @@ void WebPageProxy::needTouchEvents(bool needTouchEvents)
 }
 #endif
 
+#if ENABLE(INPUT_TYPE_COLOR)
+void WebPageProxy::showColorChooser(const WebCore::Color& initialColor)
+{
+    ASSERT(!m_colorChooser);
+
+    m_colorChooser = m_pageClient->createColorChooserProxy(this, initialColor);
+}
+
+void WebPageProxy::setColorChooserColor(const WebCore::Color& color)
+{
+    ASSERT(m_colorChooser);
+
+    m_colorChooser->setSelectedColor(color);
+}
+
+void WebPageProxy::endColorChooser()
+{
+    ASSERT(m_colorChooser);
+
+    m_colorChooser->endChooser();
+}
+
+void WebPageProxy::didChooseColor(const WebCore::Color& color)
+{
+    if (!isValid())
+        return;
+
+    process()->send(Messages::WebPage::DidChooseColor(color), m_pageID);
+}
+
+void WebPageProxy::didEndColorChooser()
+{
+    if (!isValid())
+        return;
+
+    ASSERT(m_colorChooser);
+
+    m_colorChooser->invalidate();
+    m_colorChooser = nullptr;
+
+    process()->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
+}
+#endif
+
 void WebPageProxy::didDraw()
 {
     m_uiClient.didDraw(this);
@@ -3393,6 +3445,13 @@ void WebPageProxy::processDidCrash()
         m_openPanelResultListener = nullptr;
     }
 
+#if ENABLE(INPUT_TYPE_COLOR)
+    if (m_colorChooser) {
+        m_colorChooser->invalidate();
+        m_colorChooser = nullptr;
+    }
+#endif
+
 #if ENABLE(GEOLOCATION)
     m_geolocationPermissionRequestManager.invalidateRequests();
 #endif
index 599bcc4..f31eed9 100644 (file)
@@ -45,6 +45,7 @@
 #include "ShareableBitmap.h"
 #include "WKBase.h"
 #include "WKPagePrivate.h"
+#include "WebColorChooserProxy.h"
 #include "WebContextMenuItemData.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebFindClient.h"
@@ -59,6 +60,7 @@
 #include "WebResourceLoadClient.h"
 #include "WebUIClient.h"
 #include <WebCore/AlternativeTextClient.h>
+#include <WebCore/Color.h>
 #include <WebCore/DragActions.h>
 #include <WebCore/DragSession.h>
 #include <WebCore/HitTestResult.h>
@@ -231,7 +233,12 @@ private:
     CallbackFunction m_callback;
 };
 
-class WebPageProxy : public APIObject, public WebPopupMenuProxy::Client {
+class WebPageProxy
+    : public APIObject
+#if ENABLE(INPUT_TYPE_COLOR)
+    , public WebColorChooserProxy::Client
+#endif
+    , public WebPopupMenuProxy::Client {
 public:
     static const Type APIType = TypePage;
 
@@ -810,6 +817,14 @@ private:
     void needTouchEvents(bool);
 #endif
 
+#if ENABLE(INPUT_TYPE_COLOR)
+    void showColorChooser(const WebCore::Color& initialColor);
+    void setColorChooserColor(const WebCore::Color&);
+    void endColorChooser();
+    void didChooseColor(const WebCore::Color&);
+    void didEndColorChooser();
+#endif
+
     void editorStateChanged(const EditorState&);
 
     // Back/Forward list management
@@ -1089,6 +1104,9 @@ private:
     bool m_needTouchEvents;
     Deque<QueuedTouchEvents> m_touchEventQueue;
 #endif
+#if ENABLE(INPUT_TYPE_COLOR)
+    RefPtr<WebColorChooserProxy> m_colorChooser;
+#endif
 
     uint64_t m_pageID;
 
index 06b372f..0341276 100644 (file)
@@ -83,6 +83,12 @@ messages -> WebPageProxy {
     NeedTouchEvents(bool needTouchEvents)
 #endif
 
+#if ENABLE(INPUT_TYPE_COLOR)
+    ShowColorChooser(WebCore::Color initialColor);
+    SetColorChooserColor(WebCore::Color color);
+    EndColorChooser();
+#endif
+
     # Policy messages
     DecidePolicyForResponse(uint64_t frameID, WebCore::ResourceResponse response, WebCore::ResourceRequest request, uint64_t listenerID, WebKit::InjectedBundleUserMessageEncoder userData) -> (bool receivedPolicyAction, uint64_t policyAction, uint64_t downloadID)
     DecidePolicyForNavigationAction(uint64_t frameID, uint32_t navigationType, uint32_t modifiers, int32_t mouseButton, WebCore::ResourceRequest request, uint64_t listenerID, WebKit::InjectedBundleUserMessageEncoder userData) -> (bool receivedPolicyAction, uint64_t policyAction, uint64_t downloadID)
index 8e9ab2e..eba4f8b 100644 (file)
@@ -205,6 +205,14 @@ PassRefPtr<WebContextMenuProxy> QtPageClient::createContextMenuProxy(WebPageProx
     return WebContextMenuProxyQt::create(webPageProxy);
 }
 
+#if ENABLE(INPUT_TYPE_COLOR)
+PassRefPtr<WebColorChooserProxy> QtPageClient::createColorChooserProxy(WebPageProxy*, const WebCore::Color&)
+{
+    notImplemented();
+    return 0;
+}
+#endif
+
 void QtPageClient::flashBackingStoreUpdates(const Vector<IntRect>&)
 {
     notImplemented();
index e33dadf..5c69ac8 100644 (file)
@@ -86,6 +86,9 @@ public:
     virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool wasEventHandled) { }
     virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
     virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*);
+#if ENABLE(INPUT_TYPE_COLOR)
+    virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& intialColor);
+#endif
     virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate) { }
     virtual void didCommitLoadForMainFrame(bool useCustomRepresentation) { }
     virtual void didFinishLoadingDataForCustomRepresentation(const String& suggestedFilename, const CoreIPC::DataReference&) { }
index f6e75d6..28d26f1 100644 (file)
@@ -1429,6 +1429,14 @@ PassRefPtr<WebContextMenuProxy> WebView::createContextMenuProxy(WebPageProxy* pa
     return WebContextMenuProxyWin::create(m_window, page);
 }
 
+#if ENABLE(INPUT_TYPE_COLOR)
+PassRefPtr<WebColorChooserProxy> WebView::createColorChooserProxy(WebPageProxy*, const WebCore::Color&)
+{
+    notImplemented();
+    return 0;
+}
+#endif
+
 void WebView::setFindIndicator(PassRefPtr<FindIndicator> prpFindIndicator, bool fadeOut, bool animate)
 {
     UNUSED_PARAM(animate);
index dba1593..71a9e57 100644 (file)
@@ -198,6 +198,9 @@ private:
     virtual void compositionSelectionChanged(bool);
     virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
     virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*);
+#if ENABLE(INPUT_TYPE_COLOR)
+    virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& intialColor);
+#endif
     virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate);
     virtual void didInstallOrUninstallPageOverlay(bool);
 
index 3f98e9b..6077f6d 100644 (file)
                37C4E9F6131C6E7E0029BD5A /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = B396EA5512E0ED2D00F4FEB7 /* config.h */; };
                37F623B812A57B6200E3FDF6 /* WKFindOptions.h in Headers */ = {isa = PBXBuildFile; fileRef = 37F623B712A57B6200E3FDF6 /* WKFindOptions.h */; settings = {ATTRIBUTES = (Private, ); }; };
                37F90DE31376560E0051CF68 /* HTTPCookieAcceptPolicy.h in Headers */ = {isa = PBXBuildFile; fileRef = F638954F133BEF38008941D5 /* HTTPCookieAcceptPolicy.h */; };
+               3F87B9BD158940120090FF62 /* WebColorChooser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 3F87B9BA15893F630090FF62 /* WebColorChooser.cpp */; };
+               3F87B9BE158940190090FF62 /* WebColorChooser.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F87B9BB15893F630090FF62 /* WebColorChooser.h */; };
+               3F87B9C0158940D80090FF62 /* WebColorChooserProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 3F87B9BF158940D80090FF62 /* WebColorChooserProxy.h */; };
                4F601432155C5AA2001FBDE0 /* BlockingResponseMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F601430155C5A32001FBDE0 /* BlockingResponseMap.h */; };
                51021E9C12B16788005C033C /* WebContextMenuClientMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */; };
                510FBB9A1288C95E00AFFDF4 /* WebContextMenuItemData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 510FBB981288C95E00AFFDF4 /* WebContextMenuItemData.cpp */; };
                37948406150C4B9600E52CE9 /* WKRenderLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKRenderLayer.cpp; sourceTree = "<group>"; };
                37948407150C4B9600E52CE9 /* WKRenderLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKRenderLayer.h; sourceTree = "<group>"; };
                37F623B712A57B6200E3FDF6 /* WKFindOptions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFindOptions.h; sourceTree = "<group>"; };
+               3F87B9BA15893F630090FF62 /* WebColorChooser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebColorChooser.cpp; sourceTree = "<group>"; };
+               3F87B9BB15893F630090FF62 /* WebColorChooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebColorChooser.h; sourceTree = "<group>"; };
+               3F87B9BF158940D80090FF62 /* WebColorChooserProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebColorChooserProxy.h; sourceTree = "<group>"; };
                4F601430155C5A32001FBDE0 /* BlockingResponseMap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlockingResponseMap.h; sourceTree = "<group>"; };
                510031F61379CACB00C8DFE4 /* WebProcessShim.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = WebProcessShim.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
                51021E9B12B16788005C033C /* WebContextMenuClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebContextMenuClientMac.mm; sourceTree = "<group>"; };
                                CEDA12DE152CCAE800D9E08D /* WebAlternativeTextClient.h */,
                                BC111A53112F4FBB00337BAB /* WebChromeClient.cpp */,
                                BC032D6010F4378D0058C15A /* WebChromeClient.h */,
+                               3F87B9BA15893F630090FF62 /* WebColorChooser.cpp */,
+                               3F87B9BB15893F630090FF62 /* WebColorChooser.h */,
                                BC111A54112F4FBB00337BAB /* WebContextMenuClient.cpp */,
                                BC032D6210F4378D0058C15A /* WebContextMenuClient.h */,
                                F6A25FDA12ADC6CC00DC40CC /* WebDatabaseManager.cpp */,
                                512E35F0130B638C00ABD19A /* WebApplicationCacheManagerProxy.messages.in */,
                                BC72BA1B11E64907001EB4EA /* WebBackForwardList.cpp */,
                                BC72BA1C11E64907001EB4EA /* WebBackForwardList.h */,
+                               3F87B9BF158940D80090FF62 /* WebColorChooserProxy.h */,
                                BC4A62A514744EC6006C681A /* WebConnectionToWebProcess.cpp */,
                                BC4A62A614744EC6006C681A /* WebConnectionToWebProcess.h */,
                                BCB9E2421120DACA00A137E0 /* WebContext.cpp */,
                                CEDA12E3152CD1B300D9E08D /* WebAlternativeTextClient.h in Headers */,
                                E19582D3153CBFD700B60875 /* PDFKitImports.h in Headers */,
                                51EFC1CF1524E62500C9A938 /* WKBundleDOMWindowExtension.h in Headers */,
+                               3F87B9BE158940190090FF62 /* WebColorChooser.h in Headers */,
+                               3F87B9C0158940D80090FF62 /* WebColorChooserProxy.h in Headers */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                                51FA2D7415212DF100C1BA0B /* InjectedBundleDOMWindowExtension.cpp in Sources */,
                                51FA2D7715212E2600C1BA0B /* WKBundleDOMWindowExtension.cpp in Sources */,
                                1A2A4B0E1586A2240090C9E9 /* ColorSpaceData.mm in Sources */,
+                               3F87B9BD158940120090FF62 /* WebColorChooser.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index c06f11b..729fc11 100644 (file)
@@ -31,6 +31,7 @@
 #include "InjectedBundleNavigationAction.h"
 #include "InjectedBundleUserMessageCoders.h"
 #include "LayerTreeHost.h"
+#include "WebColorChooser.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebFrame.h"
 #include "WebFrameLoaderClient.h"
@@ -597,10 +598,12 @@ bool WebChromeClient::paintCustomOverhangArea(GraphicsContext* context, const In
 }
 
 #if ENABLE(INPUT_TYPE_COLOR)
-PassOwnPtr<ColorChooser> WebChromeClient::createColorChooser(ColorChooserClient*, const Color&)
+PassOwnPtr<ColorChooser> WebChromeClient::createColorChooser(ColorChooserClient* client, const Color& initialColor)
 {
-    notImplemented();
-    return nullptr;
+    if (m_page->activeColorChooser())
+        return nullptr;
+
+    return adoptPtr(new WebColorChooser(m_page, client, initialColor));
 }
 #endif
 
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.cpp b/Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.cpp
new file mode 100644 (file)
index 0000000..2cb0f3c
--- /dev/null
@@ -0,0 +1,90 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+#include "config.h"
+#include "WebColorChooser.h"
+
+#if ENABLE(INPUT_TYPE_COLOR)
+
+#include "WebCoreArgumentCoders.h"
+#include "WebPage.h"
+#include "WebPageProxyMessages.h"
+#include "WebProcess.h"
+#include <WebCore/ColorChooserClient.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebColorChooser::WebColorChooser(WebPage* page, ColorChooserClient* client, const Color& initialColor)
+    : m_colorChooserClient(client)
+    , m_page(page)
+{
+    m_page->setActiveColorChooser(this);
+    WebProcess::shared().connection()->send(Messages::WebPageProxy::ShowColorChooser(initialColor), m_page->pageID());
+}
+
+WebColorChooser::~WebColorChooser()
+{
+    if (!m_page)
+        return;
+
+    m_page->setActiveColorChooser(0);
+}
+
+void WebColorChooser::didChooseColor(const Color& color)
+{
+    m_colorChooserClient->didChooseColor(color);
+}
+
+void WebColorChooser::didEndChooser()
+{
+    m_colorChooserClient->didEndChooser();
+}
+
+void WebColorChooser::disconnectFromPage()
+{
+    m_page = 0;
+}
+
+void WebColorChooser::setSelectedColor(const Color& color)
+{
+    if (!m_page)
+        return;
+
+    WebProcess::shared().connection()->send(Messages::WebPageProxy::SetColorChooserColor(color), m_page->pageID());
+}
+
+void WebColorChooser::endChooser()
+{
+    if (!m_page)
+        return;
+
+    WebProcess::shared().connection()->send(Messages::WebPageProxy::EndColorChooser(), m_page->pageID());
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(INPUT_TYPE_COLOR)
diff --git a/Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.h b/Source/WebKit2/WebProcess/WebCoreSupport/WebColorChooser.h
new file mode 100644 (file)
index 0000000..1e6feee
--- /dev/null
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. 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. AND ITS CONTRIBUTORS ``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 ITS 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 WebColorChooser_h
+#define WebColorChooser_h
+
+#if ENABLE(INPUT_TYPE_COLOR)
+
+#include <WebCore/ColorChooser.h>
+
+namespace WebCore {
+class Color;
+class ColorChooserClient;
+}
+
+namespace WebKit {
+
+class WebPage;
+
+class WebColorChooser : public WebCore::ColorChooser {
+public:
+    WebColorChooser(WebPage*, WebCore::ColorChooserClient*, const WebCore::Color&);
+    virtual ~WebColorChooser();
+
+    void didChooseColor(const WebCore::Color&);
+    void didEndChooser();
+    void disconnectFromPage();
+
+    virtual void setSelectedColor(const WebCore::Color&) OVERRIDE;
+    virtual void endChooser() OVERRIDE;
+
+private:
+    WebCore::ColorChooserClient* m_colorChooserClient;
+    WebPage* m_page;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(INPUT_TYPE_COLOR)
+
+#endif // WebColorChooser_h
index 4961505..1736bc4 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010, 2011 Apple Inc. All rights reserved.
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -47,6 +48,7 @@
 #include "WebBackForwardListItem.h"
 #include "WebBackForwardListProxy.h"
 #include "WebChromeClient.h"
+#include "WebColorChooser.h"
 #include "WebContextMenu.h"
 #include "WebContextMenuClient.h"
 #include "WebContextMessages.h"
@@ -210,6 +212,9 @@ WebPage::WebPage(uint64_t pageID, const WebPageCreationParameters& parameters)
     , m_tapHighlightController(this)
 #endif
 #endif
+#if ENABLE(INPUT_TYPE_COLOR)
+    , m_activeColorChooser(0)
+#endif
 #if ENABLE(GEOLOCATION)
     , m_geolocationPermissionRequestManager(this)
 #endif
@@ -635,6 +640,13 @@ void WebPage::close()
         m_activeOpenPanelResultListener = 0;
     }
 
+#if ENABLE(INPUT_TYPE_COLOR)
+    if (m_activeColorChooser) {
+        m_activeColorChooser->disconnectFromPage();
+        m_activeColorChooser = 0;
+    }
+#endif
+
     m_sandboxExtensionTracker.invalidate();
 
     m_underlayPage = nullptr;
@@ -2330,6 +2342,23 @@ void WebPage::setActivePopupMenu(WebPopupMenu* menu)
     m_activePopupMenu = menu;
 }
 
+#if ENABLE(INPUT_TYPE_COLOR)
+void WebPage::setActiveColorChooser(WebColorChooser* colorChooser)
+{
+    m_activeColorChooser = colorChooser;
+}
+
+void WebPage::didEndColorChooser()
+{
+    m_activeColorChooser->didEndChooser();
+}
+
+void WebPage::didChooseColor(const WebCore::Color& color)
+{
+    m_activeColorChooser->didChooseColor(color);
+}
+#endif
+
 void WebPage::setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener> openPanelResultListener)
 {
     m_activeOpenPanelResultListener = openPanelResultListener;
index f1e1142..1a13b6c 100644 (file)
@@ -123,6 +123,7 @@ class NotificationPermissionRequestManager;
 class PageOverlay;
 class PluginView;
 class SessionState;
+class WebColorChooser;
 class WebContextMenu;
 class WebContextMenuItemData;
 class WebEvent;
@@ -218,7 +219,14 @@ public:
     bool isInRedo() const { return m_isInRedo; }
 
     void setActivePopupMenu(WebPopupMenu*);
-    
+
+#if ENABLE(INPUT_TYPE_COLOR)
+    WebColorChooser* activeColorChooser() const { return m_activeColorChooser; }
+    void setActiveColorChooser(WebColorChooser*);
+    void didChooseColor(const WebCore::Color&);
+    void didEndColorChooser();
+#endif
+
     WebOpenPanelResultListener* activeOpenPanelResultListener() const { return m_activeOpenPanelResultListener.get(); }
     void setActiveOpenPanelResultListener(PassRefPtr<WebOpenPanelResultListener>);
 
@@ -816,6 +824,9 @@ private:
 #if ENABLE(CONTEXT_MENUS)
     RefPtr<WebContextMenu> m_contextMenu;
 #endif
+#if ENABLE(INPUT_TYPE_COLOR)
+    WebColorChooser* m_activeColorChooser;
+#endif
     RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
     RefPtr<NotificationPermissionRequestManager> m_notificationPermissionRequestManager;
 
index 6404401..38f36c2 100644 (file)
@@ -45,6 +45,11 @@ messages -> WebPage {
     HighlightPotentialActivation(WebCore::IntPoint point, WebCore::IntSize area)
 #endif
 
+#if ENABLE(INPUT_TYPE_COLOR)
+    DidEndColorChooser();
+    DidChooseColor(WebCore::Color color);
+#endif
+
 #if ENABLE(CONTEXT_MENUS)
     ContextMenuHidden()
 #endif
index c2fef09..0a38c4b 100755 (executable)
                                        >
                                </File>
                                <File
+                                       RelativePath="..\WebProcess\WebCoreSupport\WebColorChooser.cpp"
+                                       >
+                               </File>
+                               <File
+                                       RelativePath="..\WebProcess\WebCoreSupport\WebColorChooser.h"
+                                       >
+                               </File>
+                               <File
                                        RelativePath="..\WebProcess\WebCoreSupport\WebContextMenuClient.cpp"
                                        >
                                </File>
                                >
                        </File>
                        <File
+                               RelativePath="..\UIProcess\WebColorChooserProxy.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\UIProcess\WebConnectionToWebProcess.cpp"
                                >
                        </File>