Update blocked/missing plug-in UI
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jul 2013 00:43:18 +0000 (00:43 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Jul 2013 00:43:18 +0000 (00:43 +0000)
commit67c193044412b31a55ba9a4b66afd87446dde894
tree310e5f13313ca48fd1e9dc480c8af384fb571fae
parentd9a28ad90162d8d1b9ebaa59abb67e55cf5d8499
Update blocked/missing plug-in UI
https://bugs.webkit.org/show_bug.cgi?id=118347
<rdar://problem/14209318>

Reviewed by Sam Weinig.

* WebCore.exp.in:
Export RenderEmbeddedObject::setPluginUnavailabilityReasonWithDescription.

* rendering/RenderEmbeddedObject.cpp:
(WebCore::replacementTextRoundedRectPressedColor):
(WebCore::replacementTextRoundedRectColor):
(WebCore::replacementTextColor):
Change colors to new design and add some more constants.

(WebCore::shouldUnavailablePluginMessageBeButton): Added.

(WebCore::RenderEmbeddedObject::setPluginUnavailabilityReasonWithDescription): Added.
(WebCore::RenderEmbeddedObject::setPluginUnavailabilityReason):
Call through to the -WithDescription variant.

(WebCore::RenderEmbeddedObject::paintReplaced):
Fill the background, and otherwise match the new design.

(WebCore::addReplacementArrowPath):
Add an arrow to the given path, inside the given rect.

(WebCore::RenderEmbeddedObject::getReplacementTextGeometry):
Add a 1px padding to the bottom of the text.
Add a circle and an arrow into the indicator as per the new design.

(WebCore::RenderEmbeddedObject::isInUnavailablePluginIndicator):
Hit-test the indicator arrow as well; otherwise, the fact that the arrow
is a hole in the path means it won't be hit.

* rendering/RenderEmbeddedObject.h:

* Platform/CoreIPC/HandleMessage.h:
(CoreIPC::callMemberFunction):
Add a 6 argument -> 4 reply message handler.
(It seems that FindPlugin is getting a little out of hand.)

* Shared/APIClientTraits.cpp:
* Shared/APIClientTraits.h:
* UIProcess/API/C/WKPage.h:
* UIProcess/WebLoaderClient.cpp:
(WebKit::WebLoaderClient::pluginLoadPolicy):
* UIProcess/WebLoaderClient.h:
Add an unavailability description out-argument to a new version of
pluginLoadPolicy, so clients can override the text of the unavailable
plugin indicator. Bump the WKPageLoaderClient version and update APIClientTraits.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::findPlugin):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
Plumb the unavailability description through to the WebProcess via
the FindPlugin message.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::createPlugin):
Acquire the unavailability description from the client
(via FindPlugin) and hand it to the RenderEmbeddedObject.

* MiniBrowser/mac/WK2BrowserWindowController.m:
(-[WK2BrowserWindowController awakeFromNib]):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::createWebViewWithOptions):
Match new WKPageLoaderClient entry.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@152824 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/rendering/RenderEmbeddedObject.cpp
Source/WebCore/rendering/RenderEmbeddedObject.h
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/CoreIPC/HandleMessage.h
Source/WebKit2/Shared/APIClientTraits.cpp
Source/WebKit2/Shared/APIClientTraits.h
Source/WebKit2/UIProcess/API/C/WKPage.h
Source/WebKit2/UIProcess/WebLoaderClient.cpp
Source/WebKit2/UIProcess/WebLoaderClient.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Tools/ChangeLog
Tools/MiniBrowser/mac/WK2BrowserWindowController.m
Tools/WebKitTestRunner/TestController.cpp