| 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 <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 1946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1957 GetRoutingID(), text_input_type != blink::WebTextInputTypeNone)); | 1957 GetRoutingID(), text_input_type != blink::WebTextInputTypeNone)); |
| 1958 #endif | 1958 #endif |
| 1959 } | 1959 } |
| 1960 | 1960 |
| 1961 void RenderViewImpl::initializeLayerTreeView() { | 1961 void RenderViewImpl::initializeLayerTreeView() { |
| 1962 RenderWidget::initializeLayerTreeView(); | 1962 RenderWidget::initializeLayerTreeView(); |
| 1963 RenderWidgetCompositor* rwc = compositor(); | 1963 RenderWidgetCompositor* rwc = compositor(); |
| 1964 if (!rwc) | 1964 if (!rwc) |
| 1965 return; | 1965 return; |
| 1966 | 1966 |
| 1967 bool use_threaded_event_handling = true; | |
| 1968 #if defined(OS_MACOSX) | |
| 1969 // Disable threaded event handling if content is not handling the elastic | |
| 1970 // overscroll effect. This includes the cases where the elastic overscroll | |
| 1971 // effect is being handled by Blink (because of command line flags) and older | |
| 1972 // operating system versions which do not have an elastic overscroll effect | |
| 1973 // (SnowLeopard, which has Aqua scrollbars which need synchronous updates). | |
| 1974 use_threaded_event_handling = compositor_deps_->IsElasticOverscrollEnabled(); | |
| 1975 #endif | |
| 1976 if (!use_threaded_event_handling) | |
| 1977 return; | |
| 1978 | |
| 1979 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | 1967 RenderThreadImpl* render_thread = RenderThreadImpl::current(); |
| 1980 // render_thread may be NULL in tests. | 1968 // render_thread may be NULL in tests. |
| 1981 InputHandlerManager* input_handler_manager = | 1969 InputHandlerManager* input_handler_manager = |
| 1982 render_thread ? render_thread->input_handler_manager() : NULL; | 1970 render_thread ? render_thread->input_handler_manager() : NULL; |
| 1983 if (input_handler_manager) { | 1971 if (input_handler_manager) { |
| 1984 input_handler_manager->AddInputHandler( | 1972 input_handler_manager->AddInputHandler( |
| 1985 GetRoutingID(), rwc->GetInputHandler(), AsWeakPtr(), | 1973 GetRoutingID(), rwc->GetInputHandler(), AsWeakPtr(), |
| 1986 webkit_preferences_.enable_scroll_animator); | 1974 webkit_preferences_.enable_scroll_animator); |
| 1987 has_added_input_handler_ = true; | 1975 has_added_input_handler_ = true; |
| 1988 } | 1976 } |
| (...skipping 978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2967 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); | 2955 INPUT_EVENT_ACK_STATE_NOT_CONSUMED); |
| 2968 } | 2956 } |
| 2969 | 2957 |
| 2970 std::unique_ptr<InputEventAck> ack( | 2958 std::unique_ptr<InputEventAck> ack( |
| 2971 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type, | 2959 new InputEventAck(InputEventAckSource::MAIN_THREAD, input_event->type, |
| 2972 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); | 2960 INPUT_EVENT_ACK_STATE_NOT_CONSUMED)); |
| 2973 OnInputEventAck(std::move(ack)); | 2961 OnInputEventAck(std::move(ack)); |
| 2974 } | 2962 } |
| 2975 | 2963 |
| 2976 } // namespace content | 2964 } // namespace content |
| OLD | NEW |