Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: ui/views/widget/root_view.cc

Issue 9221014: aura: Gesture event plumbing (skeleton). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/native_widget_aura.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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.h" 10 #include "base/message_loop.h"
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 return ui::GESTURE_STATUS_UNKNOWN; 407 return ui::GESTURE_STATUS_UNKNOWN;
408 } 408 }
409 409
410 // See if this view wants to handle the Gesture. 410 // See if this view wants to handle the Gesture.
411 GestureEvent gesture_event(e, this, gesture_handling_view_); 411 GestureEvent gesture_event(e, this, gesture_handling_view_);
412 status = gesture_handling_view_->ProcessGestureEvent(gesture_event); 412 status = gesture_handling_view_->ProcessGestureEvent(gesture_event);
413 413
414 // The view could have removed itself from the tree when handling 414 // The view could have removed itself from the tree when handling
415 // OnGestureEvent(). So handle as per OnMousePressed. NB: we 415 // OnGestureEvent(). So handle as per OnMousePressed. NB: we
416 // assume that the RootView itself cannot be so removed. 416 // assume that the RootView itself cannot be so removed.
417 if (!gesture_handling_view_) return ui::GESTURE_STATUS_UNKNOWN; 417 if (!gesture_handling_view_)
418 return ui::GESTURE_STATUS_UNKNOWN;
418 419
419 // The gesture event wasn't processed. Go up the view hierarchy and 420 // The gesture event wasn't processed. Go up the view hierarchy and
420 // dispatch the gesture event. 421 // dispatch the gesture event.
421 if (status == ui::GESTURE_STATUS_UNKNOWN) { 422 if (status == ui::GESTURE_STATUS_UNKNOWN)
422 continue; 423 continue;
423 } else if (status == ui::GESTURE_STATUS_CONSUMED) { 424 else if (status == ui::GESTURE_STATUS_CONSUMED)
424 return status; 425 return status;
425 } else { 426 else
426 return ui::GESTURE_STATUS_UNKNOWN; 427 return ui::GESTURE_STATUS_UNKNOWN;
427 }
428 } 428 }
429 return status; 429 return status;
430 } 430 }
431 431
432 void RootView::SetMouseHandler(View *new_mh) { 432 void RootView::SetMouseHandler(View *new_mh) {
433 // If we're clearing the mouse handler, clear explicit_mouse_handler_ as well. 433 // If we're clearing the mouse handler, clear explicit_mouse_handler_ as well.
434 explicit_mouse_handler_ = (new_mh != NULL); 434 explicit_mouse_handler_ = (new_mh != NULL);
435 mouse_pressed_handler_ = new_mh; 435 mouse_pressed_handler_ = new_mh;
436 drag_info_.Reset(); 436 drag_info_.Reset();
437 } 437 }
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 // TODO(Gajen): This should be removed in future once all views are capable 523 // TODO(Gajen): This should be removed in future once all views are capable
524 // of handling OnGestureEvent. 524 // of handling OnGestureEvent.
525 return gesture_manager_->ProcessTouchEventForGesture(event, this, 525 return gesture_manager_->ProcessTouchEventForGesture(event, this,
526 status); 526 status);
527 } 527 }
528 return synthetic; 528 return synthetic;
529 } 529 }
530 530
531 } // namespace internal 531 } // namespace internal
532 } // namespace views 532 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_aura.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698