Need API to control page underlay color
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2013 00:47:10 +0000 (00:47 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 1 Mar 2013 00:47:10 +0000 (00:47 +0000)
commit6d9bfc5831f32b0075d5aea718e29948119afd2f
treece7366406b2b6813d0177f83588ffa2a45440fb5
parent9b79c85180e7d3cf79f2e4e8d9a8056436d9ec05
Need API to control page underlay color
https://bugs.webkit.org/show_bug.cgi?id=110918

Patch by Conrad Shultz <conrad_shultz@apple.com> on 2013-02-28
Reviewed by Simon Fraser.

Source/WebCore:

* page/ChromeClient.h:
(ChromeClient):
Declare underlayColor().

* platform/ScrollbarTheme.h:
(WebCore::ScrollbarTheme::setUpOverhangAreasLayerContents):
Have setUpOverhangAreasLayerContents() take a background color parameter.

* platform/mac/ScrollbarThemeMac.h:
(ScrollbarThemeMac):
Ditto.

* platform/mac/ScrollbarThemeMac.mm:
Include ColorMac.h.
(WebCore::ScrollbarThemeMac::setUpOverhangAreasLayerContents):
Use the passed-in background color, if valid, for the overhang area layer.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateOverflowControlsLayers):
Get the underlay color from the chrome client and pass it into setUpOverhangAreasLayerContents().

Source/WebKit2:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode):
Encode underlayColor.
(WebKit::WebPageCreationParameters::decode):
Decode underlayColor.

* Shared/WebPageCreationParameters.h:
(WebPageCreationParameters):
Add underlayColor member.

* UIProcess/API/mac/WKView.mm:
(-[WKView underlayColor]):
Accessor; retrieves the WebCore::Color from the WebPageProxy and converts it to an NSColor.
(-[WKView setUnderlayColor:]):
Mutator; converts the NSColor to a WebCore::Color and passes it to the WebPageProxy.

* UIProcess/API/mac/WKViewPrivate.h:
Add underlayColor @property.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setUnderlayColor):
Mutator; dispatches SetUnderlayColor to WebPage.
(WebKit::WebPageProxy::creationParameters):
Set the parameters' underlayColor member appropriately.

* UIProcess/WebPageProxy.h:
Declare new member functions and variable.
(WebKit::WebPageProxy::underlayColor):
Accessor.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::underlayColor):
Return the associated WebPage's underlayColor.

* WebProcess/WebCoreSupport/WebChromeClient.h:
(WebChromeClient):
Declare underlayColor().

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
Apply any underlayColor that was supplied as part of the WebPageCreationParameters.

* WebProcess/WebPage/WebPage.h:
Declare new member functions and variable.
(WebKit::WebPage::underlayColor):
Accessor.

* WebProcess/WebPage/WebPage.messages.in:
Add SetUnderlayColor message.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144397 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/page/ChromeClient.h
Source/WebCore/platform/ScrollbarTheme.h
Source/WebCore/platform/mac/ScrollbarThemeMac.h
Source/WebCore/platform/mac/ScrollbarThemeMac.mm
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPageCreationParameters.cpp
Source/WebKit2/Shared/WebPageCreationParameters.h
Source/WebKit2/UIProcess/API/mac/WKView.mm
Source/WebKit2/UIProcess/API/mac/WKViewPrivate.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in