Chromium Code Reviews| 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 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 836 } | 836 } |
| 837 } | 837 } |
| 838 | 838 |
| 839 // Merge |touch_start_result_| and |result| so the result has the highest | 839 // Merge |touch_start_result_| and |result| so the result has the highest |
| 840 // priority value according to the sequence; (DROP_EVENT, | 840 // priority value according to the sequence; (DROP_EVENT, |
| 841 // DID_HANDLE_NON_BLOCKING, DID_NOT_HANDLE). | 841 // DID_HANDLE_NON_BLOCKING, DID_NOT_HANDLE). |
| 842 if (touch_start_result_ == kEventDispositionUndefined || | 842 if (touch_start_result_ == kEventDispositionUndefined || |
| 843 touch_start_result_ == DROP_EVENT || result == DID_NOT_HANDLE) | 843 touch_start_result_ == DROP_EVENT || result == DID_NOT_HANDLE) |
| 844 touch_start_result_ = result; | 844 touch_start_result_ = result; |
| 845 | 845 |
| 846 // If |result| is still DROP_EVENT look at the touch end as | |
|
tdresser
2016/04/13 16:52:35
look at the touch end handler
dtapuska
2016/04/13 18:00:15
Done.
| |
| 847 // we may not want to discard the entire touch sequence. Note this | |
| 848 // code is explicitly after the assignment of the |touch_start_result_| | |
| 849 // so the touch moves are not sent to the main thread un-necessarily. | |
| 850 if (result == DROP_EVENT && | |
| 851 input_handler_->GetEventListenerProperties( | |
| 852 cc::EventListenerClass::kTouchEndOrCancel) != | |
| 853 cc::EventListenerProperties::kNone) { | |
| 854 result = DID_HANDLE_NON_BLOCKING; | |
| 855 } | |
| 856 | |
| 846 return result; | 857 return result; |
| 847 } | 858 } |
| 848 | 859 |
| 849 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleTouchMove( | 860 InputHandlerProxy::EventDisposition InputHandlerProxy::HandleTouchMove( |
| 850 const blink::WebTouchEvent& touch_event) { | 861 const blink::WebTouchEvent& touch_event) { |
| 851 if (touch_start_result_ != kEventDispositionUndefined) | 862 if (touch_start_result_ != kEventDispositionUndefined) |
| 852 return static_cast<EventDisposition>(touch_start_result_); | 863 return static_cast<EventDisposition>(touch_start_result_); |
| 853 return DID_NOT_HANDLE; | 864 return DID_NOT_HANDLE; |
| 854 } | 865 } |
| 855 | 866 |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1345 // is made asynchronously, to minimize divergence between main thread and | 1356 // is made asynchronously, to minimize divergence between main thread and |
| 1346 // impl thread event handling paths. | 1357 // impl thread event handling paths. |
| 1347 base::ThreadTaskRunnerHandle::Get()->PostTask( | 1358 base::ThreadTaskRunnerHandle::Get()->PostTask( |
| 1348 FROM_HERE, | 1359 FROM_HERE, |
| 1349 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, | 1360 base::Bind(&InputScrollElasticityController::ObserveGestureEventAndResult, |
| 1350 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, | 1361 scroll_elasticity_controller_->GetWeakPtr(), gesture_event, |
| 1351 scroll_result)); | 1362 scroll_result)); |
| 1352 } | 1363 } |
| 1353 | 1364 |
| 1354 } // namespace ui | 1365 } // namespace ui |
| OLD | NEW |