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

Unified Diff: content/renderer/render_view_impl.cc

Issue 678343002: Default zoom was never read from chrome://settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated comments based on feedback Created 5 years, 11 months 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
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 623cb14b38daf82935e19ba89717cf0ca615aa36..11b0e589768cb03d78112d071a2b37b664f36dd1 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3759,11 +3759,12 @@ blink::WebSpeechRecognizer* RenderViewImpl::speechRecognizer() {
void RenderViewImpl::zoomLimitsChanged(double minimum_level,
double maximum_level) {
+ // Round the double to avoid returning incorrect minimum/maximum zoom
+ // percentages.
int minimum_percent = static_cast<int>(
- ZoomLevelToZoomFactor(minimum_level) * 100);
+ ZoomLevelToZoomFactor(minimum_level) * 100 + 0.5);
sky 2015/01/22 17:30:35 If we're rounding, why not use a round api?
int maximum_percent = static_cast<int>(
- ZoomLevelToZoomFactor(maximum_level) * 100);
-
+ ZoomLevelToZoomFactor(maximum_level) * 100 + 0.5);
Send(new ViewHostMsg_UpdateZoomLimits(
routing_id_, minimum_percent, maximum_percent));
}
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698