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 "ui/views/widget/root_view.h" | 5 #include "ui/views/widget/root_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 return; | 254 return; |
255 | 255 |
256 ui::GestureEvent* gesture_event = event->AsGestureEvent(); | 256 ui::GestureEvent* gesture_event = event->AsGestureEvent(); |
257 | 257 |
258 // Do not process ui::ET_GESTURE_BEGIN events. | 258 // Do not process ui::ET_GESTURE_BEGIN events. |
259 if (gesture_event->type() == ui::ET_GESTURE_BEGIN) { | 259 if (gesture_event->type() == ui::ET_GESTURE_BEGIN) { |
260 event->SetHandled(); | 260 event->SetHandled(); |
261 return; | 261 return; |
262 } | 262 } |
263 | 263 |
264 // Do not process ui::ET_GESTURE_END events which do not correspond to the | 264 // Do not process ui::ET_GESTURE_END events if they do not correspond to the |
265 // removal of the final touch point. | 265 // removal of the final touch point or if no gesture handler has already |
| 266 // been set. |
266 if (gesture_event->type() == ui::ET_GESTURE_END && | 267 if (gesture_event->type() == ui::ET_GESTURE_END && |
267 gesture_event->details().touch_points() > 1) { | 268 (gesture_event->details().touch_points() > 1 || |
| 269 !gesture_handler_)) { |
268 event->SetHandled(); | 270 event->SetHandled(); |
269 return; | 271 return; |
270 } | 272 } |
271 | 273 |
272 // Do not process subsequent gesture scroll events if no handler was set for | 274 // Do not process subsequent gesture scroll events if no handler was set for |
273 // a ui::ET_GESTURE_SCROLL_BEGIN event. | 275 // a ui::ET_GESTURE_SCROLL_BEGIN event. |
274 if (!gesture_handler_ && | 276 if (!gesture_handler_ && |
275 (gesture_event->type() == ui::ET_GESTURE_SCROLL_UPDATE || | 277 (gesture_event->type() == ui::ET_GESTURE_SCROLL_UPDATE || |
276 gesture_event->type() == ui::ET_GESTURE_SCROLL_END || | 278 gesture_event->type() == ui::ET_GESTURE_SCROLL_END || |
277 gesture_event->type() == ui::ET_SCROLL_FLING_START)) { | 279 gesture_event->type() == ui::ET_SCROLL_FLING_START)) { |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
721 | 723 |
722 #ifndef NDEBUG | 724 #ifndef NDEBUG |
723 DCHECK(!event_dispatch_target_ || Contains(event_dispatch_target_)); | 725 DCHECK(!event_dispatch_target_ || Contains(event_dispatch_target_)); |
724 #endif | 726 #endif |
725 | 727 |
726 return details; | 728 return details; |
727 } | 729 } |
728 | 730 |
729 } // namespace internal | 731 } // namespace internal |
730 } // namespace views | 732 } // namespace views |
OLD | NEW |