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

Side by Side 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: Rouding off double value for the minimum zoom factor 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 unified diff | Download patch
« no previous file with comments | « chrome/test/base/testing_profile.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 3741 matching lines...) Expand 10 before | Expand all | Expand 10 after
3752 } 3752 }
3753 3753
3754 blink::WebSpeechRecognizer* RenderViewImpl::speechRecognizer() { 3754 blink::WebSpeechRecognizer* RenderViewImpl::speechRecognizer() {
3755 if (!speech_recognition_dispatcher_) 3755 if (!speech_recognition_dispatcher_)
3756 speech_recognition_dispatcher_ = new SpeechRecognitionDispatcher(this); 3756 speech_recognition_dispatcher_ = new SpeechRecognitionDispatcher(this);
3757 return speech_recognition_dispatcher_; 3757 return speech_recognition_dispatcher_;
3758 } 3758 }
3759 3759
3760 void RenderViewImpl::zoomLimitsChanged(double minimum_level, 3760 void RenderViewImpl::zoomLimitsChanged(double minimum_level,
3761 double maximum_level) { 3761 double maximum_level) {
3762 // Round the double before dispatching the async IPC.
sky 2015/01/15 00:45:49 You're documenting what the code is doing. Documen
3762 int minimum_percent = static_cast<int>( 3763 int minimum_percent = static_cast<int>(
3763 ZoomLevelToZoomFactor(minimum_level) * 100); 3764 ZoomLevelToZoomFactor(minimum_level) * 100 + 0.5);
3764 int maximum_percent = static_cast<int>( 3765 int maximum_percent = static_cast<int>(
3765 ZoomLevelToZoomFactor(maximum_level) * 100); 3766 ZoomLevelToZoomFactor(maximum_level) * 100 + 0.5);
3766
3767 Send(new ViewHostMsg_UpdateZoomLimits( 3767 Send(new ViewHostMsg_UpdateZoomLimits(
3768 routing_id_, minimum_percent, maximum_percent)); 3768 routing_id_, minimum_percent, maximum_percent));
3769 } 3769 }
3770 3770
3771 void RenderViewImpl::zoomLevelChanged() { 3771 void RenderViewImpl::zoomLevelChanged() {
3772 double zoom_level = webview()->zoomLevel(); 3772 double zoom_level = webview()->zoomLevel();
3773 3773
3774 // Do not send empty URLs to the browser when we are just setting the default 3774 // Do not send empty URLs to the browser when we are just setting the default
3775 // zoom level (from RendererPreferences) before the first navigation. 3775 // zoom level (from RendererPreferences) before the first navigation.
3776 if (!webview()->mainFrame()->document().url().isEmpty()) { 3776 if (!webview()->mainFrame()->document().url().isEmpty()) {
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
4098 std::vector<gfx::Size> sizes; 4098 std::vector<gfx::Size> sizes;
4099 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4099 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4100 if (!url.isEmpty()) 4100 if (!url.isEmpty())
4101 urls.push_back( 4101 urls.push_back(
4102 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4102 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4103 } 4103 }
4104 SendUpdateFaviconURL(urls); 4104 SendUpdateFaviconURL(urls);
4105 } 4105 }
4106 4106
4107 } // namespace content 4107 } // namespace content
OLDNEW
« 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