Skip to content
Permalink
Browse files
Rename WebColorChooserProxy
<rdar://problem/14528039> and https://bugs.webkit.org/show_bug.cgi?id=119025

Reviewed by Brady Eidson.

Renamed WebColorChooserProxy to WebColorPicker since the name WebColorChoooserProxy
implies that it represents the same object as WebColorChooser, which is not true.
Also, renamed createColorChooserProxy to createColorPicker in WebPageProxy and
platform-equivalent versions of it.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createColorPicker):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createColorPicker):
* UIProcess/API/qt/raw/qrawwebview.cpp:
(QRawWebViewPrivate::createColorPicker):
* UIProcess/API/qt/raw/qrawwebview_p_p.h:
* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::createColorPicker):
* UIProcess/CoordinatedGraphics/WebView.h:
* UIProcess/PageClient.h:
* UIProcess/WebColorChooserProxy.cpp: Removed.
* UIProcess/WebColorChooserProxy.h: Removed.
* UIProcess/WebColorPicker.cpp: Copied from Source/WebKit2/UIProcess/WebColorChooserProxy.cpp.
(WebKit::WebColorPicker::WebColorPicker):
(WebKit::WebColorPicker::~WebColorPicker):
(WebKit::WebColorPicker::endChooser):
(WebKit::WebColorPicker::setSelectedColor):
* UIProcess/WebColorPicker.h: Copied from Source/WebKit2/UIProcess/WebColorChooserProxy.h.
(WebKit::WebColorPicker::create):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::showColorChooser):
(WebKit::WebPageProxy::setColorChooserColor):
(WebKit::WebPageProxy::endColorChooser):
(WebKit::WebPageProxy::didEndColorChooser):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/WebPageProxy.h: Renamed m_colorChooser to m_colorPicker.
* UIProcess/qt/QtPageClient.cpp:
(WebKit::QtPageClient::createColorPicker):
* UIProcess/qt/QtPageClient.h:
* UIProcess/qt/WebColorChooserProxyQt.cpp: Removed.
* UIProcess/qt/WebColorChooserProxyQt.h: Removed.
* UIProcess/qt/WebColorPickerQt.cpp: Added.
(WebKit::ColorChooserContextObject::ColorChooserContextObject):
(WebKit::ColorChooserContextObject::currentColor):
(WebKit::ColorChooserContextObject::elementRect):
(WebKit::ColorChooserContextObject::accept):
(WebKit::ColorChooserContextObject::reject):
(WebKit::WebColorPickerQt::WebColorPickerQt):
(WebKit::WebColorPickerQt::~WebColorPickerQt):
(WebKit::WebColorPickerQt::createItem):
(WebKit::WebColorPickerQt::createContext):
(WebKit::WebColorPickerQt::setSelectedColor):
(WebKit::WebColorPickerQt::notifyColorSelected):
(WebKit::WebColorPickerQt::endChooser):
* UIProcess/qt/WebColorPickerQt.h: Added.
(WebKit::WebColorPickerQt::create):
* WebKit2.xcodeproj/project.pbxproj:


Canonical link: https://commits.webkit.org/136894@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@153108 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Ruth Fong committed Jul 25, 2013
1 parent 5421c27 commit 6ceb035fcd32486a0c7c608691379c9411f6a9ab
Show file tree
Hide file tree
Showing 22 changed files with 151 additions and 84 deletions.
@@ -265,7 +265,7 @@ set(WebKit2_SOURCES
UIProcess/WebBackForwardList.cpp
UIProcess/WebBatteryManagerProxy.cpp
UIProcess/WebBatteryProvider.cpp
UIProcess/WebColorChooserProxy.cpp
UIProcess/WebColorPicker.cpp
UIProcess/WebColorPickerResultListenerProxy.cpp
UIProcess/WebConnectionToWebProcess.cpp
UIProcess/WebContext.cpp
@@ -1,3 +1,70 @@
2013-07-24 Ruth Fong <ruth_fong@apple.com>

Rename WebColorChooserProxy
<rdar://problem/14528039> and https://bugs.webkit.org/show_bug.cgi?id=119025

Reviewed by Brady Eidson.

Renamed WebColorChooserProxy to WebColorPicker since the name WebColorChoooserProxy
implies that it represents the same object as WebColorChooser, which is not true.
Also, renamed createColorChooserProxy to createColorPicker in WebPageProxy and
platform-equivalent versions of it.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createColorPicker):
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.h:
* UIProcess/API/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::createColorPicker):
* UIProcess/API/qt/raw/qrawwebview.cpp:
(QRawWebViewPrivate::createColorPicker):
* UIProcess/API/qt/raw/qrawwebview_p_p.h:
* UIProcess/CoordinatedGraphics/WebView.cpp:
(WebKit::WebView::createColorPicker):
* UIProcess/CoordinatedGraphics/WebView.h:
* UIProcess/PageClient.h:
* UIProcess/WebColorChooserProxy.cpp: Removed.
* UIProcess/WebColorChooserProxy.h: Removed.
* UIProcess/WebColorPicker.cpp: Copied from Source/WebKit2/UIProcess/WebColorChooserProxy.cpp.
(WebKit::WebColorPicker::WebColorPicker):
(WebKit::WebColorPicker::~WebColorPicker):
(WebKit::WebColorPicker::endChooser):
(WebKit::WebColorPicker::setSelectedColor):
* UIProcess/WebColorPicker.h: Copied from Source/WebKit2/UIProcess/WebColorChooserProxy.h.
(WebKit::WebColorPicker::create):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::showColorChooser):
(WebKit::WebPageProxy::setColorChooserColor):
(WebKit::WebPageProxy::endColorChooser):
(WebKit::WebPageProxy::didEndColorChooser):
(WebKit::WebPageProxy::resetStateAfterProcessExited):
* UIProcess/WebPageProxy.h: Renamed m_colorChooser to m_colorPicker.
* UIProcess/qt/QtPageClient.cpp:
(WebKit::QtPageClient::createColorPicker):
* UIProcess/qt/QtPageClient.h:
* UIProcess/qt/WebColorChooserProxyQt.cpp: Removed.
* UIProcess/qt/WebColorChooserProxyQt.h: Removed.
* UIProcess/qt/WebColorPickerQt.cpp: Added.
(WebKit::ColorChooserContextObject::ColorChooserContextObject):
(WebKit::ColorChooserContextObject::currentColor):
(WebKit::ColorChooserContextObject::elementRect):
(WebKit::ColorChooserContextObject::accept):
(WebKit::ColorChooserContextObject::reject):
(WebKit::WebColorPickerQt::WebColorPickerQt):
(WebKit::WebColorPickerQt::~WebColorPickerQt):
(WebKit::WebColorPickerQt::createItem):
(WebKit::WebColorPickerQt::createContext):
(WebKit::WebColorPickerQt::setSelectedColor):
(WebKit::WebColorPickerQt::notifyColorSelected):
(WebKit::WebColorPickerQt::endChooser):
* UIProcess/qt/WebColorPickerQt.h: Added.
(WebKit::WebColorPickerQt::create):
* WebKit2.xcodeproj/project.pbxproj:

2013-07-24 Anders Carlsson <andersca@apple.com>

Crash when calling WKPageGetProcessIdentifier after aborted process launch
@@ -885,8 +885,8 @@ webkit2_sources += \
Source/WebKit2/UIProcess/WebBatteryManagerProxy.h \
Source/WebKit2/UIProcess/WebBatteryProvider.cpp \
Source/WebKit2/UIProcess/WebBatteryProvider.h \
Source/WebKit2/UIProcess/WebColorChooserProxy.cpp \
Source/WebKit2/UIProcess/WebColorChooserProxy.h \
Source/WebKit2/UIProcess/WebColorPicker.cpp \
Source/WebKit2/UIProcess/WebColorPicker.h \
Source/WebKit2/UIProcess/WebColorPickerResultListenerProxy.cpp \
Source/WebKit2/UIProcess/WebColorPickerResultListenerProxy.h \
Source/WebKit2/UIProcess/WebConnectionToWebProcess.cpp \
@@ -242,7 +242,7 @@ HEADERS += \
UIProcess/WebBackForwardList.h \
UIProcess/WebBatteryManagerProxy.h \
UIProcess/WebBatteryProvider.h \
UIProcess/WebColorChooserProxy.h \
UIProcess/WebColorPicker.h \
UIProcess/WebColorPickerResultListenerProxy.h \
UIProcess/WebConnectionToWebProcess.h \
UIProcess/WebContext.h \
@@ -600,7 +600,7 @@ SOURCES += \
UIProcess/WebBackForwardList.cpp \
UIProcess/WebBatteryManagerProxy.cpp \
UIProcess/WebBatteryProvider.cpp \
UIProcess/WebColorChooserProxy.cpp \
UIProcess/WebColorPicker.cpp \
UIProcess/WebColorPickerResultListenerProxy.cpp \
UIProcess/WebConnectionToWebProcess.cpp \
UIProcess/WebContext.cpp \
@@ -847,9 +847,9 @@ have?(QTQUICK) {

enable?(INPUT_TYPE_COLOR) {
HEADERS += \
UIProcess/qt/WebColorChooserProxyQt.h
UIProcess/qt/WebColorPickerQt.h
SOURCES += \
UIProcess/qt/WebColorChooserProxyQt.cpp
UIProcess/qt/WebColorPickerQt.cpp
}
}

@@ -231,7 +231,7 @@ PassRefPtr<WebContextMenuProxy> PageClientImpl::createContextMenuProxy(WebPagePr
}

#if ENABLE(INPUT_TYPE_COLOR)
PassRefPtr<WebColorChooserProxy> PageClientImpl::createColorChooserProxy(WebPageProxy*, const WebCore::Color&, const WebCore::IntRect&)
PassRefPtr<WebColorPicker> PageClientImpl::createColorPicker(WebPageProxy*, const WebCore::Color&, const WebCore::IntRect&)
{
notImplemented();
return 0;
@@ -84,7 +84,7 @@ class PageClientImpl : public PageClient {
virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*);
#if ENABLE(INPUT_TYPE_COLOR)
virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& intialColor, const WebCore::IntRect&);
virtual PassRefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& intialColor, const WebCore::IntRect&);
#endif
virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate);
virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>& updateRects);
@@ -101,7 +101,7 @@ class PageClientImpl FINAL : public PageClient {
virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*);

#if ENABLE(INPUT_TYPE_COLOR)
virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&);
virtual PassRefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&);
#endif

void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate);
@@ -393,7 +393,7 @@ - (void)redoEditing:(id)sender
}

#if ENABLE(INPUT_TYPE_COLOR)
PassRefPtr<WebColorChooserProxy> PageClientImpl::createColorChooserProxy(WebPageProxy*, const WebCore::Color&, const WebCore::IntRect&)
PassRefPtr<WebColorPicker> PageClientImpl::createColorPicker(WebPageProxy*, const WebCore::Color&, const WebCore::IntRect&)
{
notImplemented();
return 0;
@@ -190,10 +190,10 @@ PassRefPtr<WebKit::WebContextMenuProxy> QRawWebViewPrivate::createContextMenuPro
}

#if ENABLE(INPUT_TYPE_COLOR)
PassRefPtr<WebKit::WebColorChooserProxy> QRawWebViewPrivate::createColorChooserProxy(WebKit::WebPageProxy*, const WebCore::Color& intialColor, const WebCore::IntRect&)
PassRefPtr<WebKit::WebColorPicker> QRawWebViewPrivate::createColorPicker(WebKit::WebPageProxy*, const WebCore::Color& intialColor, const WebCore::IntRect&)
{
notImplemented();
return PassRefPtr<WebKit::WebColorChooserProxy>();
return PassRefPtr<WebKit::WebColorPicker>();
}
#endif

@@ -86,7 +86,7 @@ class QRawWebViewPrivate : public WebKit::PageClient {
virtual PassRefPtr<WebKit::WebContextMenuProxy> createContextMenuProxy(WebKit::WebPageProxy* webPageProxy);

#if ENABLE(INPUT_TYPE_COLOR)
virtual PassRefPtr<WebKit::WebColorChooserProxy> createColorChooserProxy(WebKit::WebPageProxy*, const WebCore::Color& intialColor, const WebCore::IntRect&);
virtual PassRefPtr<WebKit::WebColorPicker> createColorPicker(WebKit::WebPageProxy*, const WebCore::Color& intialColor, const WebCore::IntRect&);
#endif

QRawWebViewPrivate(WebKit::WebContext*, WebKit::WebPageGroup*, QRawWebViewClient*);
@@ -412,7 +412,7 @@ PassRefPtr<WebContextMenuProxy> WebView::createContextMenuProxy(WebPageProxy*)
}

#if ENABLE(INPUT_TYPE_COLOR)
PassRefPtr<WebColorChooserProxy> WebView::createColorChooserProxy(WebPageProxy*, const WebCore::Color&, const WebCore::IntRect&)
PassRefPtr<WebColorPicker> WebView::createColorPicker(WebPageProxy*, const WebCore::Color&, const WebCore::IntRect&)
{
notImplemented();
return 0;
@@ -174,7 +174,7 @@ class WebView : public TypedAPIObject<APIObject::TypeView>, public PageClient {
virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*) OVERRIDE;
virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*) OVERRIDE;
#if ENABLE(INPUT_TYPE_COLOR)
virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) OVERRIDE;
virtual PassRefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) OVERRIDE;
#endif

virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool, bool) OVERRIDE;
@@ -27,7 +27,7 @@
#define PageClient_h

#include "ShareableBitmap.h"
#include "WebColorChooserProxy.h"
#include "WebColorPicker.h"
#include "WebPageProxy.h"
#include "WebPopupMenuProxy.h"
#include <WebCore/AlternativeTextClient.h>
@@ -65,7 +65,7 @@ class WebContextMenuProxy;
class WebEditCommandProxy;
class WebPopupMenuProxy;
#if ENABLE(INPUT_TYPE_COLOR)
class WebColorChooserProxy;
class WebColorPicker;
#endif

#if PLATFORM(MAC)
@@ -187,7 +187,7 @@ class PageClient {
virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*) = 0;

#if ENABLE(INPUT_TYPE_COLOR)
virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) = 0;
virtual PassRefPtr<WebColorPicker> createColorPicker(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&) = 0;
#endif

virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool fadeOut, bool animate) = 0;
@@ -24,30 +24,30 @@
*/

#include "config.h"
#include "WebColorChooserProxy.h"
#include "WebColorPicker.h"

#if ENABLE(INPUT_TYPE_COLOR)

namespace WebKit {

WebColorChooserProxy::WebColorChooserProxy(Client* client)
WebColorPicker::WebColorPicker(Client* client)
: m_client(client)
{
}

WebColorChooserProxy::~WebColorChooserProxy()
WebColorPicker::~WebColorPicker()
{
}

void WebColorChooserProxy::endChooser()
void WebColorPicker::endChooser()
{
if (!m_client)
return;

m_client->didEndColorChooser();
}

void WebColorChooserProxy::setSelectedColor(const WebCore::Color& color)
void WebColorPicker::setSelectedColor(const WebCore::Color& color)
{
if (!m_client)
return;
@@ -23,8 +23,8 @@
* THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef WebColorChooserProxy_h
#define WebColorChooserProxy_h
#ifndef WebColorPicker_h
#define WebColorPicker_h

#if ENABLE(INPUT_TYPE_COLOR)

@@ -39,7 +39,7 @@ namespace WebKit {

class WebPageProxy;

class WebColorChooserProxy : public RefCounted<WebColorChooserProxy> {
class WebColorPicker : public RefCounted<WebColorPicker> {
public:
class Client {
protected:
@@ -50,20 +50,20 @@ class WebColorChooserProxy : public RefCounted<WebColorChooserProxy> {
virtual void didEndColorChooser() = 0;
};

static PassRefPtr<WebColorChooserProxy> create(Client* client)
static PassRefPtr<WebColorPicker> create(Client* client)
{
return adoptRef(new WebColorChooserProxy(client));
return adoptRef(new WebColorPicker(client));
}

virtual ~WebColorChooserProxy();
virtual ~WebColorPicker();

void invalidate() { m_client = 0; }

virtual void endChooser();
virtual void setSelectedColor(const WebCore::Color&);

protected:
explicit WebColorChooserProxy(Client*);
explicit WebColorPicker(Client*);

Client* m_client;
};
@@ -72,4 +72,4 @@ class WebColorChooserProxy : public RefCounted<WebColorChooserProxy> {

#endif // ENABLE(INPUT_TYPE_COLOR)

#endif // WebColorChooserProxy_h
#endif // WebColorPicker_h
@@ -576,9 +576,9 @@ void WebPageProxy::close()
}

#if ENABLE(INPUT_TYPE_COLOR)
if (m_colorChooser) {
m_colorChooser->invalidate();
m_colorChooser = nullptr;
if (m_colorPicker) {
m_colorPicker->invalidate();
m_colorPicker = nullptr;
}

if (m_colorPickerResultListener) {
@@ -2920,36 +2920,36 @@ void WebPageProxy::needTouchEvents(bool needTouchEvents)
#if ENABLE(INPUT_TYPE_COLOR)
void WebPageProxy::showColorChooser(const WebCore::Color& initialColor, const IntRect& elementRect)
{
ASSERT(!m_colorChooser);
ASSERT(!m_colorPicker);

if (m_colorPickerResultListener) {
m_colorPickerResultListener->invalidate();
m_colorPickerResultListener = nullptr;
}

m_colorPickerResultListener = WebColorPickerResultListenerProxy::create(this);
m_colorChooser = WebColorChooserProxy::create(this);
m_colorPicker = WebColorPicker::create(this);

if (m_uiClient.showColorPicker(this, initialColor.serialized(), m_colorPickerResultListener.get()))
return;

m_colorChooser = m_pageClient->createColorChooserProxy(this, initialColor, elementRect);
if (!m_colorChooser)
m_colorPicker = m_pageClient->createColorPicker(this, initialColor, elementRect);
if (!m_colorPicker)
didEndColorChooser();
}

void WebPageProxy::setColorChooserColor(const WebCore::Color& color)
{
ASSERT(m_colorChooser);
ASSERT(m_colorPicker);

m_colorChooser->setSelectedColor(color);
m_colorPicker->setSelectedColor(color);
}

void WebPageProxy::endColorChooser()
{
ASSERT(m_colorChooser);
ASSERT(m_colorPicker);

m_colorChooser->endChooser();
m_colorPicker->endChooser();
}

void WebPageProxy::didChooseColor(const WebCore::Color& color)
@@ -2965,9 +2965,9 @@ void WebPageProxy::didEndColorChooser()
if (!isValid())
return;

if (m_colorChooser) {
m_colorChooser->invalidate();
m_colorChooser = nullptr;
if (m_colorPicker) {
m_colorPicker->invalidate();
m_colorPicker = nullptr;
}

m_process->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
@@ -3836,9 +3836,9 @@ void WebPageProxy::resetStateAfterProcessExited()
}

#if ENABLE(INPUT_TYPE_COLOR)
if (m_colorChooser) {
m_colorChooser->invalidate();
m_colorChooser = nullptr;
if (m_colorPicker) {
m_colorPicker->invalidate();
m_colorPicker = nullptr;
}

if (m_colorPickerResultListener) {

0 comments on commit 6ceb035

Please sign in to comment.