PDFPlugin: Cmd-/+ should affect PDF page scale
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2013 18:42:07 +0000 (18:42 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 10 Jan 2013 18:42:07 +0000 (18:42 +0000)
commitd85193f63a61fd9d988c9b5dfa956ff4c741a13a
treeb735a78a7720f5e3ecc78b8a3bafb0032a6fc2d2
parentb10207f55c58d50084594f7ffc513cd6d749eb0d
PDFPlugin: Cmd-/+ should affect PDF page scale
https://bugs.webkit.org/show_bug.cgi?id=103285
<rdar://problem/12710469>

Reviewed by Darin Adler.

Plugins which support handling page scale themselves should also handle
page zoom, as it is a very similar concept.

This patch disables text zoom in the case of a main-frame plugin which supports
page scale factor changes, as it is not needed in the PDFPlugin case
(we can't do text-only scale for PDF), but it could be added later if needed.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::pageZoomFactorDidChange):
* UIProcess/WebPageProxy.h:
(WebPageProxy):
* UIProcess/WebPageProxy.messages.in:
Add WebPageProxy::pageZoomFactorDidChange, to notify WebPageProxy of
out-of-band page zoom factor changes (in this case, from PluginView).

* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::setPageScaleFactor):
Update WebPageProxy's notion of the current page zoom whenever PluginView
is notified of a page scale factor change.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setTextZoomFactor): We don't support text zoom in plugins, but
we also don't want it to silently act on the Frame if we have a plugin that
purports to handle page scale itself. Return early if this is the case.
(WebKit::WebPage::pageZoomFactor): For plugins that support page scale factor,
we equate page scale and page zoom. Return the PluginView's page scale factor
in place of the Frame's page zoom factor.
(WebKit::WebPage::setPageZoomFactor): Make page zoom changes in the aforementioned
case affect the PluginView's page scale.
(WebKit::WebPage::setPageAndTextZoomFactors): Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@139340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/Plugins/PluginView.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp