OLD | NEW |
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 2824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2835 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); | 2835 command_line.GetSwitchValueASCII(switches::kEnableFixedLayout); |
2836 std::vector<std::string> tokens; | 2836 std::vector<std::string> tokens; |
2837 base::SplitString(str, ',', &tokens); | 2837 base::SplitString(str, ',', &tokens); |
2838 if (tokens.size() == 2) { | 2838 if (tokens.size() == 2) { |
2839 int width, height; | 2839 int width, height; |
2840 if (base::StringToInt(tokens[0], &width) && | 2840 if (base::StringToInt(tokens[0], &width) && |
2841 base::StringToInt(tokens[1], &height)) | 2841 base::StringToInt(tokens[1], &height)) |
2842 webview()->setFixedLayoutSize(WebSize(width,height)); | 2842 webview()->setFixedLayoutSize(WebSize(width,height)); |
2843 } | 2843 } |
2844 } | 2844 } |
| 2845 webview()->setDeviceScaleFactor( |
| 2846 webkit_preferences_.default_device_scale_factor); |
2845 } | 2847 } |
2846 | 2848 |
2847 void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) { | 2849 void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) { |
2848 WebDataSource* ds = frame->provisionalDataSource(); | 2850 WebDataSource* ds = frame->provisionalDataSource(); |
2849 DocumentState* document_state = DocumentState::FromDataSource(ds); | 2851 DocumentState* document_state = DocumentState::FromDataSource(ds); |
2850 | 2852 |
2851 // Update the request time if WebKit has better knowledge of it. | 2853 // Update the request time if WebKit has better knowledge of it. |
2852 if (document_state->request_time().is_null()) { | 2854 if (document_state->request_time().is_null()) { |
2853 double event_time = ds->triggeringEventTime(); | 2855 double event_time = ds->triggeringEventTime(); |
2854 if (event_time != 0.0) | 2856 if (event_time != 0.0) |
(...skipping 2703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5558 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5560 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
5559 return !!RenderThreadImpl::current()->compositor_thread(); | 5561 return !!RenderThreadImpl::current()->compositor_thread(); |
5560 } | 5562 } |
5561 | 5563 |
5562 void RenderViewImpl::OnJavaBridgeInit() { | 5564 void RenderViewImpl::OnJavaBridgeInit() { |
5563 DCHECK(!java_bridge_dispatcher_); | 5565 DCHECK(!java_bridge_dispatcher_); |
5564 #if defined(ENABLE_JAVA_BRIDGE) | 5566 #if defined(ENABLE_JAVA_BRIDGE) |
5565 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5567 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
5566 #endif | 5568 #endif |
5567 } | 5569 } |
OLD | NEW |