summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/WebPageProxy.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/UIProcess/WebPageProxy.cpp')
-rw-r--r--Source/WebKit2/UIProcess/WebPageProxy.cpp37
1 files changed, 33 insertions, 4 deletions
diff --git a/Source/WebKit2/UIProcess/WebPageProxy.cpp b/Source/WebKit2/UIProcess/WebPageProxy.cpp
index 4ac6d2243..8fd72a0c6 100644
--- a/Source/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/Source/WebKit2/UIProcess/WebPageProxy.cpp
@@ -52,6 +52,7 @@
#include "WebBackForwardList.h"
#include "WebBackForwardListItem.h"
#include "WebCertificateInfo.h"
+#include "WebColorPickerResultListenerProxy.h"
#include "WebContext.h"
#include "WebContextMenuProxy.h"
#include "WebContextUserMessageCoders.h"
@@ -413,6 +414,11 @@ void WebPageProxy::close()
m_colorChooser->invalidate();
m_colorChooser = nullptr;
}
+
+ if (m_colorPickerResultListener) {
+ m_colorPickerResultListener->invalidate();
+ m_colorPickerResultListener = nullptr;
+ }
#endif
#if ENABLE(GEOLOCATION)
@@ -2724,7 +2730,20 @@ void WebPageProxy::showColorChooser(const WebCore::Color& initialColor, const In
{
ASSERT(!m_colorChooser);
+ if (m_colorPickerResultListener) {
+ m_colorPickerResultListener->invalidate();
+ m_colorPickerResultListener = nullptr;
+ }
+
+ m_colorPickerResultListener = WebColorPickerResultListenerProxy::create(this);
+ m_colorChooser = WebColorChooserProxy::create(this);
+
+ if (m_uiClient.showColorPicker(this, initialColor.serialized(), m_colorPickerResultListener.get()))
+ return;
+
m_colorChooser = m_pageClient->createColorChooserProxy(this, initialColor, elementRect);
+ if (!m_colorChooser)
+ didEndColorChooser();
}
void WebPageProxy::setColorChooserColor(const WebCore::Color& color)
@@ -2754,12 +2773,17 @@ void WebPageProxy::didEndColorChooser()
if (!isValid())
return;
- ASSERT(m_colorChooser);
-
- m_colorChooser->invalidate();
- m_colorChooser = nullptr;
+ if (m_colorChooser) {
+ m_colorChooser->invalidate();
+ m_colorChooser = nullptr;
+ }
m_process->send(Messages::WebPage::DidEndColorChooser(), m_pageID);
+
+ m_colorPickerResultListener->invalidate();
+ m_colorPickerResultListener = nullptr;
+
+ m_uiClient.hideColorPicker(this);
}
#endif
@@ -3536,6 +3560,11 @@ void WebPageProxy::processDidCrash()
m_colorChooser->invalidate();
m_colorChooser = nullptr;
}
+
+ if (m_colorPickerResultListener) {
+ m_colorPickerResultListener->invalidate();
+ m_colorPickerResultListener = nullptr;
+ }
#endif
#if ENABLE(GEOLOCATION)