| 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/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 1525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1536 frame->SendUpdateState(); | 1536 frame->SendUpdateState(); |
| 1537 } | 1537 } |
| 1538 frames_with_pending_state_.clear(); | 1538 frames_with_pending_state_.clear(); |
| 1539 } | 1539 } |
| 1540 | 1540 |
| 1541 void RenderViewImpl::ApplyWebPreferencesInternal( | 1541 void RenderViewImpl::ApplyWebPreferencesInternal( |
| 1542 const WebPreferences& prefs, | 1542 const WebPreferences& prefs, |
| 1543 blink::WebView* web_view, | 1543 blink::WebView* web_view, |
| 1544 CompositorDependencies* compositor_deps) { | 1544 CompositorDependencies* compositor_deps) { |
| 1545 ApplyWebPreferences(prefs, web_view); | 1545 ApplyWebPreferences(prefs, web_view); |
| 1546 #if defined(OS_MACOSX) && !defined(OS_IOS) | 1546 #if defined(OS_MACOSX) |
| 1547 DCHECK(compositor_deps); | 1547 DCHECK(compositor_deps); |
| 1548 bool is_elastic_overscroll_enabled = | 1548 bool is_elastic_overscroll_enabled = |
| 1549 compositor_deps->IsElasticOverscrollEnabled(); | 1549 compositor_deps->IsElasticOverscrollEnabled(); |
| 1550 web_view->settings()->setReportWheelOverscroll(is_elastic_overscroll_enabled); | 1550 web_view->settings()->setReportWheelOverscroll(is_elastic_overscroll_enabled); |
| 1551 #endif | 1551 #endif |
| 1552 } | 1552 } |
| 1553 | 1553 |
| 1554 bool RenderViewImpl::SendAndRunNestedMessageLoop(IPC::SyncMessage* message) { | 1554 bool RenderViewImpl::SendAndRunNestedMessageLoop(IPC::SyncMessage* message) { |
| 1555 // Before WebKit asks us to show an alert (etc.), it takes care of doing the | 1555 // Before WebKit asks us to show an alert (etc.), it takes care of doing the |
| 1556 // equivalent of WebView::willEnterModalLoop. In the case of showModalDialog | 1556 // equivalent of WebView::willEnterModalLoop. In the case of showModalDialog |
| (...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2116 #endif | 2116 #endif |
| 2117 } | 2117 } |
| 2118 | 2118 |
| 2119 void RenderViewImpl::initializeLayerTreeView() { | 2119 void RenderViewImpl::initializeLayerTreeView() { |
| 2120 RenderWidget::initializeLayerTreeView(); | 2120 RenderWidget::initializeLayerTreeView(); |
| 2121 RenderWidgetCompositor* rwc = compositor(); | 2121 RenderWidgetCompositor* rwc = compositor(); |
| 2122 if (!rwc) | 2122 if (!rwc) |
| 2123 return; | 2123 return; |
| 2124 | 2124 |
| 2125 bool use_threaded_event_handling = true; | 2125 bool use_threaded_event_handling = true; |
| 2126 #if defined(OS_MACOSX) && !defined(OS_IOS) | 2126 #if defined(OS_MACOSX) |
| 2127 // Disable threaded event handling if content is not handling the elastic | 2127 // Disable threaded event handling if content is not handling the elastic |
| 2128 // overscroll effect. This includes the cases where the elastic overscroll | 2128 // overscroll effect. This includes the cases where the elastic overscroll |
| 2129 // effect is being handled by Blink (because of command line flags) and older | 2129 // effect is being handled by Blink (because of command line flags) and older |
| 2130 // operating system versions which do not have an elastic overscroll effect | 2130 // operating system versions which do not have an elastic overscroll effect |
| 2131 // (SnowLeopard, which has Aqua scrollbars which need synchronous updates). | 2131 // (SnowLeopard, which has Aqua scrollbars which need synchronous updates). |
| 2132 use_threaded_event_handling = compositor_deps_->IsElasticOverscrollEnabled(); | 2132 use_threaded_event_handling = compositor_deps_->IsElasticOverscrollEnabled(); |
| 2133 #endif | 2133 #endif |
| 2134 if (use_threaded_event_handling) { | 2134 if (use_threaded_event_handling) { |
| 2135 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 2135 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
| 2136 // render_thread may be NULL in tests. | 2136 // render_thread may be NULL in tests. |
| (...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3524 if (IsUseZoomForDSFEnabled()) { | 3524 if (IsUseZoomForDSFEnabled()) { |
| 3525 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); | 3525 webview()->setZoomFactorForDeviceScaleFactor(device_scale_factor_); |
| 3526 } else { | 3526 } else { |
| 3527 webview()->setDeviceScaleFactor(device_scale_factor_); | 3527 webview()->setDeviceScaleFactor(device_scale_factor_); |
| 3528 } | 3528 } |
| 3529 webview()->settings()->setPreferCompositingToLCDTextEnabled( | 3529 webview()->settings()->setPreferCompositingToLCDTextEnabled( |
| 3530 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); | 3530 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); |
| 3531 } | 3531 } |
| 3532 | 3532 |
| 3533 } // namespace content | 3533 } // namespace content |
| OLD | NEW |