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 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
550 "Renderer4.MainThreadWheelScrollReason"; | 550 "Renderer4.MainThreadWheelScrollReason"; |
551 | 551 |
552 DCHECK(device == blink::kWebGestureDeviceTouchpad || | 552 DCHECK(device == blink::kWebGestureDeviceTouchpad || |
553 device == blink::kWebGestureDeviceTouchscreen); | 553 device == blink::kWebGestureDeviceTouchscreen); |
554 | 554 |
555 if (device != blink::kWebGestureDeviceTouchpad && | 555 if (device != blink::kWebGestureDeviceTouchpad && |
556 device != blink::kWebGestureDeviceTouchscreen) { | 556 device != blink::kWebGestureDeviceTouchscreen) { |
557 return; | 557 return; |
558 } | 558 } |
559 | 559 |
560 // NonCompositedScrollReasons should only be set on the main thread. | |
561 DCHECK( | |
562 !cc::MainThreadScrollingReason::HasNonCompositedScrollReasons(reasons)); | |
563 | |
564 // UMA_HISTOGRAM_ENUMERATION requires that the enum_max must be strictly | 560 // UMA_HISTOGRAM_ENUMERATION requires that the enum_max must be strictly |
565 // greater than the sample value. kMainThreadScrollingReasonCount doesn't | 561 // greater than the sample value. kMainThreadScrollingReasonCount doesn't |
566 // include the NotScrollingOnMain enum but the histograms do so adding | 562 // include the NotScrollingOnMain enum but the histograms do so adding |
567 // the +1 is necessary. | 563 // the +1 is necessary. |
568 // TODO(dcheng): Fix https://crbug.com/705169 so this isn't needed. | 564 // TODO(dcheng): Fix https://crbug.com/705169 so this isn't needed. |
569 constexpr uint32_t kMainThreadScrollingReasonEnumMax = | 565 constexpr uint32_t kMainThreadScrollingReasonEnumMax = |
570 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount + 1; | 566 cc::MainThreadScrollingReason::kMainThreadScrollingReasonCount + 1; |
571 if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) { | 567 if (reasons == cc::MainThreadScrollingReason::kNotScrollingOnMain) { |
572 if (device == blink::kWebGestureDeviceTouchscreen) { | 568 if (device == blink::kWebGestureDeviceTouchscreen) { |
573 UMA_HISTOGRAM_ENUMERATION( | 569 UMA_HISTOGRAM_ENUMERATION( |
(...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1645 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, | 1641 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, |
1646 scroll_result)); | 1642 scroll_result)); |
1647 } | 1643 } |
1648 | 1644 |
1649 void InputHandlerProxy::SetTickClockForTesting( | 1645 void InputHandlerProxy::SetTickClockForTesting( |
1650 std::unique_ptr<base::TickClock> tick_clock) { | 1646 std::unique_ptr<base::TickClock> tick_clock) { |
1651 tick_clock_ = std::move(tick_clock); | 1647 tick_clock_ = std::move(tick_clock); |
1652 } | 1648 } |
1653 | 1649 |
1654 } // namespace ui | 1650 } // namespace ui |
OLD | NEW |