Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1538)

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 8528011: Page zoom improvements (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: One last(?) tweak. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/tab_contents/tab_contents.cc
===================================================================
--- content/browser/tab_contents/tab_contents.cc (revision 110998)
+++ content/browser/tab_contents/tab_contents.cc (working copy)
@@ -197,9 +197,9 @@
opener_web_ui_type_(WebUI::kNoWebUI),
closed_by_user_gesture_(false),
minimum_zoom_percent_(
- static_cast<int>(WebKit::WebView::minTextSizeMultiplier * 100)),
+ static_cast<int>(content::kMinimumZoomFactor * 100)),
maximum_zoom_percent_(
- static_cast<int>(WebKit::WebView::maxTextSizeMultiplier * 100)),
+ static_cast<int>(content::kMaximumZoomFactor * 100)),
temporary_zoom_settings_(false),
content_restrictions_(0),
view_type_(content::VIEW_TYPE_TAB_CONTENTS) {
@@ -862,8 +862,10 @@
int TabContents::GetZoomPercent(bool* enable_increment,
bool* enable_decrement) {
*enable_decrement = *enable_increment = false;
+ // Calculate the zoom percent from the factor. Round up to the nearest whole
+ // number.
int percent = static_cast<int>(
- WebKit::WebView::zoomLevelToZoomFactor(GetZoomLevel()) * 100);
+ WebKit::WebView::zoomLevelToZoomFactor(GetZoomLevel()) * 100 + 0.5);
*enable_decrement = percent > minimum_zoom_percent_;
*enable_increment = percent < maximum_zoom_percent_;
return percent;

Powered by Google App Engine
This is Rietveld 408576698