Chromium Code Reviews| 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 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 3159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3170 } | 3170 } |
| 3171 } | 3171 } |
| 3172 | 3172 |
| 3173 ProcessAcceleratedPinchZoomFlags(command_line); | 3173 ProcessAcceleratedPinchZoomFlags(command_line); |
| 3174 } | 3174 } |
| 3175 | 3175 |
| 3176 void RenderViewImpl::ProcessAcceleratedPinchZoomFlags( | 3176 void RenderViewImpl::ProcessAcceleratedPinchZoomFlags( |
| 3177 const CommandLine& command_line) { | 3177 const CommandLine& command_line) { |
| 3178 bool enable_viewport = | 3178 bool enable_viewport = |
| 3179 command_line.HasSwitch(switches::kEnableViewport); | 3179 command_line.HasSwitch(switches::kEnableViewport); |
| 3180 bool enable_pinch = enable_viewport || | 3180 bool enable_pinch = enable_viewport || |
|
aelias_OOO_until_Jul13
2012/12/03 18:34:35
This logic is broken because enable_viewport is al
| |
| 3181 command_line.HasSwitch(switches::kEnablePinch); | 3181 command_line.HasSwitch(switches::kEnablePinch); |
| 3182 bool enable_pinch_in_compositor = | 3182 bool enable_css_transform_pinch = |
| 3183 command_line.HasSwitch(cc::switches::kEnablePinchInCompositor); | 3183 command_line.HasSwitch(switches::kEnableCssTransformPinch); |
| 3184 | 3184 |
| 3185 if (!enable_pinch && | 3185 if (!(enable_pinch || enable_css_transform_pinch) && |
| 3186 webview()->isAcceleratedCompositingActive() && | 3186 webview()->isAcceleratedCompositingActive() && |
| 3187 webkit_preferences_.apply_default_device_scale_factor_in_compositor && | 3187 webkit_preferences_.apply_default_device_scale_factor_in_compositor && |
| 3188 device_scale_factor_ != 1) { | 3188 device_scale_factor_ != 1) { |
| 3189 // Page scaling is disabled by default when applying a scale factor in the | 3189 // Page scaling is disabled by default when applying a scale factor in the |
| 3190 // compositor since they are currently incompatible. | 3190 // compositor since they are currently incompatible. |
| 3191 webview()->setPageScaleFactorLimits(1, 1); | 3191 webview()->setPageScaleFactorLimits(1, 1); |
| 3192 } | 3192 } |
| 3193 | 3193 |
| 3194 if (enable_pinch_in_compositor && | 3194 if (enable_pinch && webview()->isAcceleratedCompositingActive()) |
| 3195 webview()->isAcceleratedCompositingActive()) | |
| 3196 webview()->setPageScaleFactorLimits(1, 4); | 3195 webview()->setPageScaleFactorLimits(1, 4); |
| 3197 } | 3196 } |
| 3198 | 3197 |
| 3199 void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) { | 3198 void RenderViewImpl::didStartProvisionalLoad(WebFrame* frame) { |
| 3200 WebDataSource* ds = frame->provisionalDataSource(); | 3199 WebDataSource* ds = frame->provisionalDataSource(); |
| 3201 DocumentState* document_state = DocumentState::FromDataSource(ds); | 3200 DocumentState* document_state = DocumentState::FromDataSource(ds); |
| 3202 | 3201 |
| 3203 // Update the request time if WebKit has better knowledge of it. | 3202 // Update the request time if WebKit has better knowledge of it. |
| 3204 if (document_state->request_time().is_null()) { | 3203 if (document_state->request_time().is_null()) { |
| 3205 double event_time = ds->triggeringEventTime(); | 3204 double event_time = ds->triggeringEventTime(); |
| (...skipping 3232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6438 } | 6437 } |
| 6439 #endif | 6438 #endif |
| 6440 | 6439 |
| 6441 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( | 6440 void RenderViewImpl::OnReleaseDisambiguationPopupDIB( |
| 6442 TransportDIB::Handle dib_handle) { | 6441 TransportDIB::Handle dib_handle) { |
| 6443 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); | 6442 TransportDIB* dib = TransportDIB::CreateWithHandle(dib_handle); |
| 6444 RenderProcess::current()->ReleaseTransportDIB(dib); | 6443 RenderProcess::current()->ReleaseTransportDIB(dib); |
| 6445 } | 6444 } |
| 6446 | 6445 |
| 6447 } // namespace content | 6446 } // namespace content |
| OLD | NEW |