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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 10386160: Set deviceScaleFactor on the renderer WebView to enable scaling when not in fixed-layout mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 2705 matching lines...) Expand 10 before | Expand all | Expand 10 after
2716 std::string str = 2716 std::string str =
2717 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); 2717 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout);
2718 std::vector<std::string> tokens; 2718 std::vector<std::string> tokens;
2719 base::SplitString(str, ',', &tokens); 2719 base::SplitString(str, ',', &tokens);
2720 if (tokens.size() == 2) { 2720 if (tokens.size() == 2) {
2721 int width, height; 2721 int width, height;
2722 if (base::StringToInt(tokens[0], &width) && 2722 if (base::StringToInt(tokens[0], &width) &&
2723 base::StringToInt(tokens[1], &height)) 2723 base::StringToInt(tokens[1], &height))
2724 webview()->setFixedLayoutSize(WebSize(width,height)); 2724 webview()->setFixedLayoutSize(WebSize(width,height));
2725 } 2725 }
2726 } else {
2727 int device_scale = webkit_preferences_.default_device_scale_factor;
2728 webview()->setDeviceScaleFactor(device_scale);
2729 webview()->setPageScaleFactorLimits(1, WebKit::WebView::maxPageScaleFactor);
2726 } 2730 }
2727 } 2731 }
2728 2732
2729 void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) { 2733 void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) {
2730 WebDataSource* ds = frame->provisionalDataSource(); 2734 WebDataSource* ds = frame->provisionalDataSource();
2731 DocumentState* document_state = DocumentState::FromDataSource(ds); 2735 DocumentState* document_state = DocumentState::FromDataSource(ds);
2732 2736
2733 // Update the request time if WebKit has better knowledge of it. 2737 // Update the request time if WebKit has better knowledge of it.
2734 if (document_state->request_time().is_null()) { 2738 if (document_state->request_time().is_null()) {
2735 double event_time = ds->triggeringEventTime(); 2739 double event_time = ds->triggeringEventTime();
(...skipping 2585 matching lines...) Expand 10 before | Expand all | Expand 10 after
5321 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 5325 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
5322 return !!RenderThreadImpl::current()->compositor_thread(); 5326 return !!RenderThreadImpl::current()->compositor_thread();
5323 } 5327 }
5324 5328
5325 void RenderViewImpl::OnJavaBridgeInit() { 5329 void RenderViewImpl::OnJavaBridgeInit() {
5326 DCHECK(!java_bridge_dispatcher_); 5330 DCHECK(!java_bridge_dispatcher_);
5327 #if defined(ENABLE_JAVA_BRIDGE) 5331 #if defined(ENABLE_JAVA_BRIDGE)
5328 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); 5332 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this);
5329 #endif 5333 #endif
5330 } 5334 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698