OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ui/events/blink/input_handler_proxy.h" | 5 #include "ui/events/blink/input_handler_proxy.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 "Renderer4.MainThreadWheelScrollReason"; | 545 "Renderer4.MainThreadWheelScrollReason"; |
546 | 546 |
547 DCHECK(device == blink::WebGestureDeviceTouchpad || | 547 DCHECK(device == blink::WebGestureDeviceTouchpad || |
548 device == blink::WebGestureDeviceTouchscreen); | 548 device == blink::WebGestureDeviceTouchscreen); |
549 | 549 |
550 if (device != blink::WebGestureDeviceTouchpad && | 550 if (device != blink::WebGestureDeviceTouchpad && |
551 device != blink::WebGestureDeviceTouchscreen) { | 551 device != blink::WebGestureDeviceTouchscreen) { |
552 return; | 552 return; |
553 } | 553 } |
554 | 554 |
| 555 // NonCompositedScrollReasons should only be set on the main thread. |
| 556 DCHECK(!cc::MainThreadScrollingReason::NonCompositedScrollReasons(reasons)); |
| 557 |
555 // UMA_HISTOGRAM_ENUMERATION requires that the enum_max must be strictly | 558 // UMA_HISTOGRAM_ENUMERATION requires that the enum_max must be strictly |
556 // greater than the sample value. kMainThreadScrollingReasonCount doesn't | 559 // greater than the sample value. kMainThreadScrollingReasonCount doesn't |
557 // include the NotScrollingOnMain enum but the histograms do so adding | 560 // include the NotScrollingOnMain enum but the histograms do so adding |
558 // the +1 is necessary. | 561 // the +1 is necessary. |
559 // TODO(dcheng): Fix https://crbug.com/705169 so this isn't needed. | 562 // TODO(dcheng): Fix https://crbug.com/705169 so this isn't needed. |
560 constexpr uint32_t kMainThreadScrollingReasonEnumMax = | 563 constexpr uint32_t kMainThreadScrollingReasonEnumMax = |
561 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount + 1; | 564 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount + 1; |
562 if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) { | 565 if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) { |
563 if (device == blink::WebGestureDeviceTouchscreen) { | 566 if (device == blink::WebGestureDeviceTouchscreen) { |
564 UMA_HISTOGRAM_ENUMERATION( | 567 UMA_HISTOGRAM_ENUMERATION( |
(...skipping 1069 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1634 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, | 1637 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, |
1635 scroll_result)); | 1638 scroll_result)); |
1636 } | 1639 } |
1637 | 1640 |
1638 void InputHandlerProxy::SetTickClockForTesting( | 1641 void InputHandlerProxy::SetTickClockForTesting( |
1639 std::unique_ptr<base::TickClock> tick_clock) { | 1642 std::unique_ptr<base::TickClock> tick_clock) { |
1640 tick_clock_ = std::move(tick_clock); | 1643 tick_clock_ = std::move(tick_clock); |
1641 } | 1644 } |
1642 | 1645 |
1643 } // namespace ui | 1646 } // namespace ui |
OLD | NEW |