Commit 0e934500 authored by fsamuel@chromium.org's avatar fsamuel@chromium.org

Enabled scaling zoom for TOUCH_UI.

This patch depends on landing this WebKit patch first:

https://bugs.webkit.org/show_bug.cgi?id=66067


BUG=none
TEST=manually


Review URL: http://codereview.chromium.org/7619015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96694 0039d316-1c4b-4281-b951-d872f2087c98
parent df9dda5e
...@@ -263,6 +263,8 @@ static const int kMaximumNumberOfUnacknowledgedPopups = 25; ...@@ -263,6 +263,8 @@ static const int kMaximumNumberOfUnacknowledgedPopups = 25;
static const char kBackForwardNavigationScheme[] = "history"; static const char kBackForwardNavigationScheme[] = "history";
static const float kScalingIncrement = 0.1f;
static void GetRedirectChain(WebDataSource* ds, std::vector<GURL>* result) { static void GetRedirectChain(WebDataSource* ds, std::vector<GURL>* result) {
WebVector<WebURL> urls; WebVector<WebURL> urls;
ds->redirectChain(urls); ds->redirectChain(urls);
...@@ -3377,7 +3379,7 @@ void RenderView::OnZoom(PageZoom::Function function) { ...@@ -3377,7 +3379,7 @@ void RenderView::OnZoom(PageZoom::Function function) {
return; return;
webview()->hidePopups(); webview()->hidePopups();
#if !defined(TOUCH_UI)
double old_zoom_level = webview()->zoomLevel(); double old_zoom_level = webview()->zoomLevel();
double zoom_level; double zoom_level;
if (function == PageZoom::RESET) { if (function == PageZoom::RESET) {
...@@ -3398,8 +3400,18 @@ void RenderView::OnZoom(PageZoom::Function function) { ...@@ -3398,8 +3400,18 @@ void RenderView::OnZoom(PageZoom::Function function) {
zoom_level = static_cast<int>(old_zoom_level); zoom_level = static_cast<int>(old_zoom_level);
} }
} }
webview()->setZoomLevel(false, zoom_level); webview()->setZoomLevel(false, zoom_level);
#else
double old_page_scale_factor = webview()->pageScaleFactor();
double page_scale_factor;
if (function == PageZoom::RESET) {
page_scale_factor = 1.0;
} else {
page_scale_factor = old_page_scale_factor +
(function > 0 ? kScalingIncrement : -kScalingIncrement);
}
webview()->scalePage(page_scale_factor, WebPoint(0, 0));
#endif
zoomLevelChanged(); zoomLevelChanged();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment