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

Side by Side Diff: ui/views/view.h

Issue 10912063: events: Get rid of GestureStatus in favour of EventResult. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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/controls/textfield/native_textfield_views.cc ('k') | ui/views/view.cc » ('j') | 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 #ifndef UI_VIEWS_VIEW_H_ 5 #ifndef UI_VIEWS_VIEW_H_
6 #define UI_VIEWS_VIEW_H_ 6 #define UI_VIEWS_VIEW_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 // The provided event location is always (0, 0) 572 // The provided event location is always (0, 0)
573 // Default implementation does nothing. Override as needed. 573 // Default implementation does nothing. Override as needed.
574 virtual void OnMouseExited(const ui::MouseEvent& event); 574 virtual void OnMouseExited(const ui::MouseEvent& event);
575 575
576 // This method is invoked for each touch event. Default implementation 576 // This method is invoked for each touch event. Default implementation
577 // does nothing. Override as needed. 577 // does nothing. Override as needed.
578 virtual ui::TouchStatus OnTouchEvent(const ui::TouchEvent& event); 578 virtual ui::TouchStatus OnTouchEvent(const ui::TouchEvent& event);
579 579
580 // This method is invoked for each GestureEvent created by GestureRecognizer. 580 // This method is invoked for each GestureEvent created by GestureRecognizer.
581 // Default implementation does nothing. Override as needed. 581 // Default implementation does nothing. Override as needed.
582 // If a View returns ui::GESTURE_STATUS_CONSUMED from OnGestureEvent, then 582 // If a View returns ui::ER_CONSUMED from OnGestureEvent, then
583 // subsequent gestures will be dispatched to the same View, until the gesture 583 // subsequent gestures will be dispatched to the same View, until the gesture
584 // ends (i.e. all touch-points are released). 584 // ends (i.e. all touch-points are released).
585 // Scroll gesture events are handled slightly differently: if a View starts 585 // Scroll gesture events are handled slightly differently: if a View starts
586 // processing gesture events, but does not process an ET_GESTURE_SCROLL_BEGIN 586 // processing gesture events, but does not process an ET_GESTURE_SCROLL_BEGIN
587 // gesture, then the scroll-gesture event will bubble up (i.e. will be sent to 587 // gesture, then the scroll-gesture event will bubble up (i.e. will be sent to
588 // the parent view for processing). If a View then returns 588 // the parent view for processing). If a View then returns
589 // GESTURE_STATUS_CONSUMED from OnGestureEvent, then the subsequent 589 // GESTURE_STATUS_CONSUMED from OnGestureEvent, then the subsequent
590 // scroll-gesture events will be sent to this View. However all the other 590 // scroll-gesture events will be sent to this View. However all the other
591 // gesture-events (e.g. ET_GESTURE_END, ET_GESTURE_PINCH_BEGIN etc.) will 591 // gesture-events (e.g. ET_GESTURE_END, ET_GESTURE_PINCH_BEGIN etc.) will
592 // continue to be dispatched to the first View. 592 // continue to be dispatched to the first View.
593 virtual ui::GestureStatus OnGestureEvent(const ui::GestureEvent& event); 593 virtual ui::EventResult OnGestureEvent(const ui::GestureEvent& event);
594 594
595 // Set the MouseHandler for a drag session. 595 // Set the MouseHandler for a drag session.
596 // 596 //
597 // A drag session is a stream of mouse events starting 597 // A drag session is a stream of mouse events starting
598 // with a MousePressed event, followed by several MouseDragged 598 // with a MousePressed event, followed by several MouseDragged
599 // events and finishing with a MouseReleased event. 599 // events and finishing with a MouseReleased event.
600 // 600 //
601 // This method should be only invoked while processing a 601 // This method should be only invoked while processing a
602 // MouseDragged or MousePressed event. 602 // MouseDragged or MousePressed event.
603 // 603 //
(...skipping 675 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 bool ProcessMousePressed(const ui::MouseEvent& event, DragInfo* drop_info); 1279 bool ProcessMousePressed(const ui::MouseEvent& event, DragInfo* drop_info);
1280 bool ProcessMouseDragged(const ui::MouseEvent& event, DragInfo* drop_info); 1280 bool ProcessMouseDragged(const ui::MouseEvent& event, DragInfo* drop_info);
1281 void ProcessMouseReleased(const ui::MouseEvent& event); 1281 void ProcessMouseReleased(const ui::MouseEvent& event);
1282 1282
1283 // RootView will invoke this with incoming TouchEvents. Returns the result 1283 // RootView will invoke this with incoming TouchEvents. Returns the result
1284 // of OnTouchEvent. 1284 // of OnTouchEvent.
1285 ui::TouchStatus ProcessTouchEvent(const ui::TouchEvent& event); 1285 ui::TouchStatus ProcessTouchEvent(const ui::TouchEvent& event);
1286 1286
1287 // RootView will invoke this with incoming GestureEvents. This will invoke 1287 // RootView will invoke this with incoming GestureEvents. This will invoke
1288 // OnGestureEvent and return the result. 1288 // OnGestureEvent and return the result.
1289 ui::GestureStatus ProcessGestureEvent(const ui::GestureEvent& event); 1289 ui::EventResult ProcessGestureEvent(const ui::GestureEvent& event);
1290 1290
1291 // Accelerators -------------------------------------------------------------- 1291 // Accelerators --------------------------------------------------------------
1292 1292
1293 // Registers this view's keyboard accelerators that are not registered to 1293 // Registers this view's keyboard accelerators that are not registered to
1294 // FocusManager yet, if possible. 1294 // FocusManager yet, if possible.
1295 void RegisterPendingAccelerators(); 1295 void RegisterPendingAccelerators();
1296 1296
1297 // Unregisters all the keyboard accelerators associated with this view. 1297 // Unregisters all the keyboard accelerators associated with this view.
1298 // |leave_data_intact| if true does not remove data from accelerators_ array, 1298 // |leave_data_intact| if true does not remove data from accelerators_ array,
1299 // so it could be re-registered with other focus manager 1299 // so it could be re-registered with other focus manager
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
1472 base::win::ScopedComPtr<NativeViewAccessibilityWin> 1472 base::win::ScopedComPtr<NativeViewAccessibilityWin>
1473 native_view_accessibility_win_; 1473 native_view_accessibility_win_;
1474 #endif 1474 #endif
1475 1475
1476 DISALLOW_COPY_AND_ASSIGN(View); 1476 DISALLOW_COPY_AND_ASSIGN(View);
1477 }; 1477 };
1478 1478
1479 } // namespace views 1479 } // namespace views
1480 1480
1481 #endif // UI_VIEWS_VIEW_H_ 1481 #endif // UI_VIEWS_VIEW_H_
OLDNEW
« no previous file with comments | « ui/views/controls/textfield/native_textfield_views.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698