Title: [93007] trunk/Source/WebKit/chromium
- Revision
- 93007
- Author
- [email protected]
- Date
- 2011-08-12 15:56:35 -0700 (Fri, 12 Aug 2011)
Log Message
Expose pageScaleFactor() to Chromium's WebViewImpl
https://bugs.webkit.org/show_bug.cgi?id=66067
Reviewed by Darin Fisher.
* public/WebView.h:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::pageScaleFactor):
* src/WebViewImpl.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit/chromium/ChangeLog (93006 => 93007)
--- trunk/Source/WebKit/chromium/ChangeLog 2011-08-12 22:48:27 UTC (rev 93006)
+++ trunk/Source/WebKit/chromium/ChangeLog 2011-08-12 22:56:35 UTC (rev 93007)
@@ -1,3 +1,15 @@
+2011-08-12 Fady Samuel <[email protected]>
+
+ Expose pageScaleFactor() to Chromium's WebViewImpl
+ https://bugs.webkit.org/show_bug.cgi?id=66067
+
+ Reviewed by Darin Fisher.
+
+ * public/WebView.h:
+ * src/WebViewImpl.cpp:
+ (WebKit::WebViewImpl::pageScaleFactor):
+ * src/WebViewImpl.h:
+
2011-08-12 Sadrul Habib Chowdhury <[email protected]>
Wire gesture tap events, add support for gesture events in the DRT and add a layout test for it.
Modified: trunk/Source/WebKit/chromium/public/WebView.h (93006 => 93007)
--- trunk/Source/WebKit/chromium/public/WebView.h 2011-08-12 22:48:27 UTC (rev 93006)
+++ trunk/Source/WebKit/chromium/public/WebView.h 2011-08-12 22:56:35 UTC (rev 93007)
@@ -203,6 +203,10 @@
WEBKIT_EXPORT static double zoomLevelToZoomFactor(double zoomLevel);
WEBKIT_EXPORT static double zoomFactorToZoomLevel(double factor);
+ // Gets the scale factor of the page, where 1.0 is the normal size, > 1.0
+ // is scaled up, < 1.0 is scaled down.
+ virtual float pageScaleFactor() const = 0;
+
// Scales a page by a factor of scaleFactor and then sets a scroll position to (x, y).
// scalePage() magnifies and shrinks a page without affecting layout.
// On the other hand, zooming affects layout of the page.
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (93006 => 93007)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2011-08-12 22:48:27 UTC (rev 93006)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp 2011-08-12 22:56:35 UTC (rev 93007)
@@ -1838,6 +1838,18 @@
return log(factor) / log(textSizeMultiplierRatio);
}
+float WebViewImpl::pageScaleFactor() const
+{
+ if (!page())
+ return 1.0;
+
+ Frame* frame = page()->mainFrame();
+ if (!frame)
+ return 1.0;
+
+ return frame->pageScaleFactor();
+}
+
void WebViewImpl::scalePage(float scaleFactor, WebPoint origin)
{
if (!page())
Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.h (93006 => 93007)
--- trunk/Source/WebKit/chromium/src/WebViewImpl.h 2011-08-12 22:48:27 UTC (rev 93006)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.h 2011-08-12 22:56:35 UTC (rev 93007)
@@ -155,6 +155,7 @@
virtual double setZoomLevel(bool textOnly, double zoomLevel);
virtual void zoomLimitsChanged(double minimumZoomLevel,
double maximumZoomLevel);
+ virtual float pageScaleFactor() const;
virtual void scalePage(float scaleFactor, WebPoint origin);
virtual void performMediaPlayerAction(
const WebMediaPlayerAction& action,
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes