Diff
Modified: trunk/Source/WebCore/ChangeLog (103168 => 103169)
--- trunk/Source/WebCore/ChangeLog 2011-12-18 07:03:20 UTC (rev 103168)
+++ trunk/Source/WebCore/ChangeLog 2011-12-18 10:37:10 UTC (rev 103169)
@@ -1,3 +1,12 @@
+2011-12-18 Keishi Hattori <kei...@webkit.org>
+
+ Implement <input type=color> UI WebKit chromium part
+ https://bugs.webkit.org/show_bug.cgi?id=65897
+
+ Reviewed by Darin Fisher.
+
+ * WebCore.gypi: Added ColorChooser.h and ColorChooserClient.h
+
2011-12-17 Keishi Hattori <kei...@webkit.org>
Refactor input type color WebCore part
Modified: trunk/Source/WebCore/WebCore.gypi (103168 => 103169)
--- trunk/Source/WebCore/WebCore.gypi 2011-12-18 07:03:20 UTC (rev 103168)
+++ trunk/Source/WebCore/WebCore.gypi 2011-12-18 10:37:10 UTC (rev 103169)
@@ -667,6 +667,8 @@
'page/mac/WebCoreFrameView.h',
'platform/AsyncFileStream.h',
'platform/Clock.h',
+ 'platform/ColorChooser.h',
+ 'platform/ColorChooserClient.h',
'platform/ContextMenu.h',
'platform/ContextMenuItem.h',
'platform/Cookie.h',
Deleted: trunk/Source/WebCore/platform/ColorChooser.cpp (103168 => 103169)
--- trunk/Source/WebCore/platform/ColorChooser.cpp 2011-12-18 07:03:20 UTC (rev 103168)
+++ trunk/Source/WebCore/platform/ColorChooser.cpp 2011-12-18 10:37:10 UTC (rev 103169)
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2011 Google Inc. 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.
- * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
- * its contributors may be used to endorse or promote products derived
- * from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE 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 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 "ColorChooser.h"
-
-#include <wtf/PassOwnPtr.h>
-
-#if ENABLE(INPUT_COLOR)
-
-namespace WebCore {
-
-ColorChooserClient::~ColorChooserClient()
-{
- discardChooser();
-}
-
-ColorChooser* ColorChooserClient::newColorChooser()
-{
- discardChooser();
-
- m_chooser = ColorChooser::create(this);
- return m_chooser.get();
-}
-
-void ColorChooserClient::discardChooser()
-{
- if (m_chooser)
- m_chooser->disconnectClient();
- m_chooser.clear();
-}
-
-inline ColorChooser::ColorChooser(ColorChooserClient* client)
- : m_client(client)
-{
-}
-
-PassRefPtr<ColorChooser> ColorChooser::create(ColorChooserClient* client)
-{
- return adoptRef(new ColorChooser(client));
-}
-
-ColorChooser::~ColorChooser()
-{
-}
-
-void ColorChooser::didChooseColor(const Color& color)
-{
- if (m_client)
- m_client->didChooseColor(color);
-}
-
-void ColorChooser::didCleanup()
-{
- if (m_client)
- m_client->didCleanup();
-}
-
-}
-
-#endif // ENABLE(INPUT_COLOR)
Modified: trunk/Source/WebKit/chromium/ChangeLog (103168 => 103169)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-12-18 07:03:20 UTC (rev 103168)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-12-18 10:37:10 UTC (rev 103169)
@@ -1,3 +1,38 @@
+2011-12-18 Keishi Hattori <kei...@webkit.org>
+
+ Implement <input type=color> UI WebKit chromium part
+ https://bugs.webkit.org/show_bug.cgi?id=65897
+
+ Reviewed by Darin Fisher.
+
+ * WebKit.gyp: Added new files.
+ * features.gypi: Added ENABLE_INPUT_COLOR.
+ * public/WebColorChooser.h: Added. Interface for ColorChooserProxy to call.
+ (WebKit::WebColorChooser::~WebColorChooser):
+ (WebKit::WebColorChooser::setSelectedColor):
+ (WebKit::WebColorChooser::endChooser):
+ * public/WebColorChooserClient.h: Added.
+ (WebKit::WebColorChooserClient::~WebColorChooserClient):
+ (WebKit::WebColorChooserClient::didChooseColor): Only called when user changes the color.
+ (WebKit::WebColorChooserClient::didEndChooser): Called when WebColorChooser::endChooser is called.
+ * public/WebViewClient.h:
+ (WebKit::WebViewClient::createColorChooser): Creates a new color chooser. If there is an old color chooser, this will end it.
+ * src/ChromeClientImpl.cpp:
+ (WebKit::ChromeClientImpl::createColorChooser): Calls WebViewClient::createColorChooser.
+ * src/ChromeClientImpl.h:
+ * src/ColorChooserProxy.cpp: Proxies calls to WebCore::ColorChooser to WebKit::WebColorChooser.
+ (WebKit::ColorChooserProxy::ColorChooserProxy):
+ (WebKit::ColorChooserProxy::~ColorChooserProxy):
+ (WebKit::ColorChooserProxy::setSelectedColor):
+ (WebKit::ColorChooserProxy::endChooser):
+ * src/ColorChooserProxy.h:
+ * src/WebColorChooserClientImpl.cpp: Proxies calls to WebKit::WebColorChooserClient to WebCore::ColorChooserClient.
+ (WebKit::WebColorChooserClientImpl::WebColorChooserClientImpl):
+ (WebKit::WebColorChooserClientImpl::~WebColorChooserClientImpl):
+ (WebKit::WebColorChooserClientImpl::didChooseColor):
+ (WebKit::WebColorChooserClientImpl::didEndChooser):
+ * src/WebColorChooserClientImpl.h: Added.
+
2011-12-17 Sam Weinig <s...@webkit.org>
Make PlatformTouchEvent inherit from PlatformEvent
Modified: trunk/Source/WebKit/chromium/WebKit.gyp (103168 => 103169)
--- trunk/Source/WebKit/chromium/WebKit.gyp 2011-12-18 07:03:20 UTC (rev 103168)
+++ trunk/Source/WebKit/chromium/WebKit.gyp 2011-12-18 10:37:10 UTC (rev 103169)
@@ -106,6 +106,8 @@
'public/WebBindings.h',
'public/WebBlob.h',
'public/WebCache.h',
+ 'public/WebColorChooser.h',
+ 'public/WebColorChooserClient.h',
'public/WebCommonWorkerClient.h',
'public/WebCompositionUnderline.h',
'public/WebCompositor.h',
@@ -370,6 +372,8 @@
'src/CCThreadImpl.h',
'src/ChromeClientImpl.cpp',
'src/ChromeClientImpl.h',
+ 'src/ColorChooserProxy.cpp',
+ 'src/ColorChooserProxy.h',
'src/ChromiumCurrentTime.cpp',
'src/ChromiumOSRandomSource.cpp',
'src/ChromiumThreading.cpp',
@@ -481,6 +485,8 @@
'src/WebBlobData.cpp',
'src/WebCache.cpp',
'src/WebColor.cpp',
+ 'src/WebColorChooserClientImpl.cpp',
+ 'src/WebColorChooserClientImpl.h',
'src/WebCommon.cpp',
'src/WebCompositorImpl.cpp',
'src/WebCompositorImpl.h',
Modified: trunk/Source/WebKit/chromium/features.gypi (103168 => 103169)
--- trunk/Source/WebKit/chromium/features.gypi 2011-12-18 07:03:20 UTC (rev 103168)
+++ trunk/Source/WebKit/chromium/features.gypi 2011-12-18 10:37:10 UTC (rev 103169)
@@ -53,6 +53,7 @@
'ENABLE_GESTURE_RECOGNIZER=1',
'ENABLE_ICONDATABASE=0',
'ENABLE_INDEXED_DATABASE=1',
+ 'ENABLE_INPUT_COLOR=0',
'ENABLE_INPUT_SPEECH=1',
'ENABLE_INPUT_TYPE_COLOR=0',
'ENABLE_INPUT_TYPE_DATE=0',
Copied: trunk/Source/WebKit/chromium/public/WebColorChooser.h (from rev 103168, trunk/Source/WebCore/platform/ColorChooser.cpp) (0 => 103169)
--- trunk/Source/WebKit/chromium/public/WebColorChooser.h (rev 0)
+++ trunk/Source/WebKit/chromium/public/WebColorChooser.h 2011-12-18 10:37:10 UTC (rev 103169)
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2011 Google Inc. 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 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 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
+
+#include "platform/WebColor.h"
+#include "platform/WebCommon.h"
+
+namespace WebKit {
+
+// This represents a color chooser.
+class WebColorChooser {
+public:
+ virtual ~WebColorChooser() { }
+
+ // Set selected color in the color chooser.
+ virtual void setSelectedColor(const WebColor color) { }
+
+ // Calling this ends the color chooser and the client won't be recieving
+ // didChooseColor callbacks anymore.
+ virtual void endChooser() { }
+};
+
+}
+
+#endif // WebColorChooser_h
Copied: trunk/Source/WebKit/chromium/public/WebColorChooserClient.h (from rev 103168, trunk/Source/WebCore/platform/ColorChooser.cpp) (0 => 103169)
--- trunk/Source/WebKit/chromium/public/WebColorChooserClient.h (rev 0)
+++ trunk/Source/WebKit/chromium/public/WebColorChooserClient.h 2011-12-18 10:37:10 UTC (rev 103169)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2011 Google Inc. 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 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 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 WebColorChooserClient_h
+#define WebColorChooserClient_h
+
+#include "platform/WebColor.h"
+#include "platform/WebCommon.h"
+
+namespace WebKit {
+
+// Receives calls from WebColorChooser and passes it to the WebCore side.
+class WebColorChooserClient {
+public:
+ virtual ~WebColorChooserClient() { }
+
+ // Called when user selects a color in the color chooser.
+ virtual void didChooseColor(const WebColor&) { }
+
+ // Called when color chooser has ended.
+ virtual void didEndChooser() { }
+};
+
+}
+
+#endif // WebColorChooserClient_h
Modified: trunk/Source/WebKit/chromium/public/WebViewClient.h (103168 => 103169)
--- trunk/Source/WebKit/chromium/public/WebViewClient.h 2011-12-18 07:03:20 UTC (rev 103168)
+++ trunk/Source/WebKit/chromium/public/WebViewClient.h 2011-12-18 10:37:10 UTC (rev 103169)
@@ -41,11 +41,14 @@
#include "WebTextAffinity.h"
#include "WebTextDirection.h"
#include "WebWidgetClient.h"
+#include "platform/WebColor.h"
#include "platform/WebString.h"
namespace WebKit {
class WebAccessibilityObject;
+class WebColorChooser;
+class WebColorChooserClient;
class WebDeviceOrientationClient;
class WebDragData;
class WebElement;
@@ -177,9 +180,15 @@
// indicating that the default action should be suppressed.
virtual bool handleCurrentKeyboardEvent() { return false; }
-
// Dialogs -------------------------------------------------------------
+ // This method opens the color chooser and returns a new WebColorChooser
+ // instance. If there is a WebColorChooser already from the last time this
+ // was called, it ends the color chooser by calling endChooser, and replaces
+ // it with the new one.
+ virtual WebColorChooser* createColorChooser(WebColorChooserClient*,
+ const WebColor&) { return 0; }
+
// This method returns immediately after showing the dialog. When the
// dialog is closed, it should call the WebFileChooserCompletion to
// pass the results of the dialog. Returns false if
Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp (103168 => 103169)
--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp 2011-12-18 07:03:20 UTC (rev 103168)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.cpp 2011-12-18 10:37:10 UTC (rev 103169)
@@ -34,6 +34,11 @@
#include "AXObjectCache.h"
#include "AccessibilityObject.h"
+#if ENABLE(INPUT_COLOR)
+#include "ColorChooser.h"
+#include "ColorChooserClient.h"
+#include "ColorChooserProxy.h"
+#endif
#include "Console.h"
#include "Cursor.h"
#include "DatabaseTracker.h"
@@ -68,6 +73,10 @@
#include "V8Proxy.h"
#endif
#include "WebAccessibilityObject.h"
+#if ENABLE(INPUT_COLOR)
+#include "WebColorChooser.h"
+#include "WebColorChooserClientImpl.h"
+#endif
#include "WebConsoleMessage.h"
#include "WebCursorInfo.h"
#include "WebFileChooserCompletionImpl.h"
@@ -675,6 +684,21 @@
ASSERT_NOT_REACHED();
}
+#if ENABLE(INPUT_COLOR)
+PassOwnPtr<ColorChooser> ChromeClientImpl::createColorChooser(ColorChooserClient* chooserClient, const Color& initialColor)
+{
+ WebViewClient* client = m_webView->client();
+ if (!client)
+ return nullptr;
+ WebColorChooserClientImpl* chooserClientProxy = new WebColorChooserClientImpl(chooserClient);
+ WebColor webColor = static_cast<WebColor>(initialColor.rgb());
+ WebColorChooser* chooser = client->createColorChooser(chooserClientProxy, webColor);
+ if (!chooser)
+ return nullptr;
+ return adoptPtr(new ColorChooserProxy(adoptPtr(chooser)));
+}
+#endif
+
void ChromeClientImpl::runOpenPanel(Frame* frame, PassRefPtr<FileChooser> fileChooser)
{
WebViewClient* client = m_webView->client();
Modified: trunk/Source/WebKit/chromium/src/ChromeClientImpl.h (103168 => 103169)
--- trunk/Source/WebKit/chromium/src/ChromeClientImpl.h 2011-12-18 07:03:20 UTC (rev 103168)
+++ trunk/Source/WebKit/chromium/src/ChromeClientImpl.h 2011-12-18 10:37:10 UTC (rev 103169)
@@ -38,6 +38,10 @@
namespace WebCore {
class AccessibilityObject;
+#if ENABLE(INPUT_COLOR)
+class ColorChooser;
+class ColorChooserClient;
+#endif
class Element;
class FileChooser;
class PopupContainer;
@@ -134,6 +138,9 @@
virtual bool paintCustomOverhangArea(WebCore::GraphicsContext*, const WebCore::IntRect&, const WebCore::IntRect&, const WebCore::IntRect&);
virtual void requestGeolocationPermissionForFrame(WebCore::Frame*, WebCore::Geolocation*);
virtual void cancelGeolocationPermissionRequestForFrame(WebCore::Frame*, WebCore::Geolocation*);
+#if ENABLE(INPUT_COLOR)
+ virtual PassOwnPtr<WebCore::ColorChooser> createColorChooser(WebCore::ColorChooserClient*, const WebCore::Color&) OVERRIDE;
+#endif
virtual void runOpenPanel(WebCore::Frame*, PassRefPtr<WebCore::FileChooser>);
virtual void loadIconForFiles(const Vector<WTF::String>&, WebCore::FileIconLoader*);
#if ENABLE(DIRECTORY_UPLOAD)
Copied: trunk/Source/WebKit/chromium/src/ColorChooserProxy.cpp (from rev 103168, trunk/Source/WebCore/platform/ColorChooser.cpp) (0 => 103169)
--- trunk/Source/WebKit/chromium/src/ColorChooserProxy.cpp (rev 0)
+++ trunk/Source/WebKit/chromium/src/ColorChooserProxy.cpp 2011-12-18 10:37:10 UTC (rev 103169)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2011 Google Inc. 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 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 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 "ColorChooserProxy.h"
+
+#include "Color.h"
+#include "WebColorChooser.h"
+#include "platform/WebColor.h"
+
+#if ENABLE(INPUT_COLOR)
+
+namespace WebKit {
+
+ColorChooserProxy::ColorChooserProxy(PassOwnPtr<WebColorChooser> chooser) : m_chooser(chooser)
+{
+}
+
+ColorChooserProxy::~ColorChooserProxy()
+{
+}
+
+void ColorChooserProxy::setSelectedColor(const WebCore::Color& color)
+{
+ if (!m_chooser)
+ return;
+ WebColor webColor = static_cast<WebColor>(color.rgb());
+ m_chooser->setSelectedColor(webColor);
+}
+
+void ColorChooserProxy::endChooser()
+{
+ if (!m_chooser)
+ return;
+ m_chooser->endChooser();
+}
+
+}
+
+#endif // ENABLE(INPUT_COLOR)
Copied: trunk/Source/WebKit/chromium/src/ColorChooserProxy.h (from rev 103168, trunk/Source/WebCore/platform/ColorChooser.cpp) (0 => 103169)
--- trunk/Source/WebKit/chromium/src/ColorChooserProxy.h (rev 0)
+++ trunk/Source/WebKit/chromium/src/ColorChooserProxy.h 2011-12-18 10:37:10 UTC (rev 103169)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2011 Google Inc. 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 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 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 ColorChooserProxy_h
+#define ColorChooserProxy_h
+
+#include "ColorChooser.h"
+#include "WebColorChooser.h"
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+
+#if ENABLE(INPUT_COLOR)
+
+namespace WebKit {
+
+class ColorChooserProxy : public WebCore::ColorChooser {
+public:
+ ColorChooserProxy(PassOwnPtr<WebColorChooser>);
+ virtual ~ColorChooserProxy();
+
+ virtual void setSelectedColor(const WebCore::Color&);
+ virtual void endChooser();
+
+private:
+ OwnPtr<WebColorChooser> m_chooser;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(INPUT_COLOR)
+
+#endif // ColorChooserProxy_h
Copied: trunk/Source/WebKit/chromium/src/WebColorChooserClientImpl.cpp (from rev 103168, trunk/Source/WebCore/platform/ColorChooser.cpp) (0 => 103169)
--- trunk/Source/WebKit/chromium/src/WebColorChooserClientImpl.cpp (rev 0)
+++ trunk/Source/WebKit/chromium/src/WebColorChooserClientImpl.cpp 2011-12-18 10:37:10 UTC (rev 103169)
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2011 Google Inc. 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 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 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 "WebColorChooserClientImpl.h"
+
+#include "Color.h"
+#include "ColorChooserClient.h"
+
+#if ENABLE(INPUT_COLOR)
+
+namespace WebKit {
+
+WebColorChooserClientImpl::WebColorChooserClientImpl(WebCore::ColorChooserClient* client) : m_client(client)
+{
+}
+
+WebColorChooserClientImpl::~WebColorChooserClientImpl()
+{
+}
+
+void WebColorChooserClientImpl::didChooseColor(const WebColor& color)
+{
+ if (!m_client)
+ return;
+ m_client->didChooseColor(WebCore::Color(static_cast<WebCore::RGBA32>(color)));
+}
+
+void WebColorChooserClientImpl::didEndChooser()
+{
+ if (!m_client)
+ return;
+ m_client->didEndChooser();
+}
+
+}
+
+#endif // ENABLE(INPUT_COLOR)
Copied: trunk/Source/WebKit/chromium/src/WebColorChooserClientImpl.h (from rev 103168, trunk/Source/WebCore/platform/ColorChooser.cpp) (0 => 103169)
--- trunk/Source/WebKit/chromium/src/WebColorChooserClientImpl.h (rev 0)
+++ trunk/Source/WebKit/chromium/src/WebColorChooserClientImpl.h 2011-12-18 10:37:10 UTC (rev 103169)
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2011 Google Inc. 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 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 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 WebColorChooserClientImpl_h
+#define WebColorChooserClientImpl_h
+
+#include "WebColorChooserClient.h"
+
+#if ENABLE(INPUT_COLOR)
+
+namespace WebCore {
+class ColorChooserClient;
+}
+
+namespace WebKit {
+
+class WebColorChooserClientImpl : public WebColorChooserClient {
+public:
+ WebColorChooserClientImpl(WebCore::ColorChooserClient*);
+ virtual ~WebColorChooserClientImpl();
+
+ virtual void didChooseColor(const WebColor&) OVERRIDE;
+ virtual void didEndChooser() OVERRIDE;
+
+private:
+ WebCore::ColorChooserClient* m_client;
+};
+
+}
+
+#endif // ENABLE(INPUT_COLOR)
+
+#endif // WebColorChooserClientImpl_h