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