OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_VIEW_H_ | 5 #ifndef VIEWS_VIEW_H_ |
6 #define VIEWS_VIEW_H_ | 6 #define VIEWS_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 | 10 |
(...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
614 // subsequent MouseDragged and MouseReleased events. | 614 // subsequent MouseDragged and MouseReleased events. |
615 // | 615 // |
616 // Default implementation returns true if a ContextMenuController has been | 616 // Default implementation returns true if a ContextMenuController has been |
617 // set, false otherwise. Override as needed. | 617 // set, false otherwise. Override as needed. |
618 // | 618 // |
619 virtual bool OnMouseDragged(const MouseEvent& event); | 619 virtual bool OnMouseDragged(const MouseEvent& event); |
620 | 620 |
621 // This method is invoked when the user releases the mouse | 621 // This method is invoked when the user releases the mouse |
622 // button. The event is in the receiver's coordinate system. | 622 // button. The event is in the receiver's coordinate system. |
623 // | 623 // |
624 // If canceled is true it indicates the mouse press/drag was canceled by a | |
625 // system/user gesture. | |
626 // | |
627 // Default implementation notifies the ContextMenuController is appropriate. | 624 // Default implementation notifies the ContextMenuController is appropriate. |
628 // Subclasses that wish to honor the ContextMenuController should invoke | 625 // Subclasses that wish to honor the ContextMenuController should invoke |
629 // super. | 626 // super. |
630 virtual void OnMouseReleased(const MouseEvent& event, bool canceled); | 627 virtual void OnMouseReleased(const MouseEvent& event); |
| 628 |
| 629 // This method is invoked when the mouse press/drag was canceled by a |
| 630 // system/user gesture. |
| 631 virtual void OnMouseCaptureLost(); |
631 | 632 |
632 // This method is invoked when the mouse is above this control | 633 // This method is invoked when the mouse is above this control |
633 // The event is in the receiver's coordinate system. | 634 // The event is in the receiver's coordinate system. |
634 // | 635 // |
635 // Default implementation does nothing. Override as needed. | 636 // Default implementation does nothing. Override as needed. |
636 virtual void OnMouseMoved(const MouseEvent& event); | 637 virtual void OnMouseMoved(const MouseEvent& event); |
637 | 638 |
638 // This method is invoked when the mouse enters this control. | 639 // This method is invoked when the mouse enters this control. |
639 // | 640 // |
640 // Default implementation does nothing. Override as needed. | 641 // Default implementation does nothing. Override as needed. |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1223 // point was successfully from the ancestor's coordinate system to the view's | 1224 // point was successfully from the ancestor's coordinate system to the view's |
1224 // coordinate system. | 1225 // coordinate system. |
1225 bool ConvertPointFromAncestor(const View* ancestor, gfx::Point* point) const; | 1226 bool ConvertPointFromAncestor(const View* ancestor, gfx::Point* point) const; |
1226 | 1227 |
1227 // Input --------------------------------------------------------------------- | 1228 // Input --------------------------------------------------------------------- |
1228 | 1229 |
1229 // RootView invokes these. These in turn invoke the appropriate OnMouseXXX | 1230 // RootView invokes these. These in turn invoke the appropriate OnMouseXXX |
1230 // method. If a drag is detected, DoDrag is invoked. | 1231 // method. If a drag is detected, DoDrag is invoked. |
1231 bool ProcessMousePressed(const MouseEvent& event, DragInfo* drop_info); | 1232 bool ProcessMousePressed(const MouseEvent& event, DragInfo* drop_info); |
1232 bool ProcessMouseDragged(const MouseEvent& event, DragInfo* drop_info); | 1233 bool ProcessMouseDragged(const MouseEvent& event, DragInfo* drop_info); |
1233 void ProcessMouseReleased(const MouseEvent& event, bool canceled); | 1234 void ProcessMouseReleased(const MouseEvent& event); |
1234 | 1235 |
1235 #if defined(TOUCH_UI) | 1236 #if defined(TOUCH_UI) |
1236 // RootView will invoke this with incoming TouchEvents. Returns the | 1237 // RootView will invoke this with incoming TouchEvents. Returns the |
1237 // the result of OnTouchEvent. | 1238 // the result of OnTouchEvent. |
1238 TouchStatus ProcessTouchEvent(const TouchEvent& event); | 1239 TouchStatus ProcessTouchEvent(const TouchEvent& event); |
1239 #endif | 1240 #endif |
1240 | 1241 |
1241 // Accelerators -------------------------------------------------------------- | 1242 // Accelerators -------------------------------------------------------------- |
1242 | 1243 |
1243 // Registers this view's keyboard accelerators that are not registered to | 1244 // Registers this view's keyboard accelerators that are not registered to |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1394 // The Windows-specific accessibility implementation for this View. | 1395 // The Windows-specific accessibility implementation for this View. |
1395 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; | 1396 scoped_refptr<NativeViewAccessibilityWin> native_view_accessibility_win_; |
1396 #endif | 1397 #endif |
1397 | 1398 |
1398 DISALLOW_COPY_AND_ASSIGN(View); | 1399 DISALLOW_COPY_AND_ASSIGN(View); |
1399 }; | 1400 }; |
1400 | 1401 |
1401 } // namespace views | 1402 } // namespace views |
1402 | 1403 |
1403 #endif // VIEWS_VIEW_H_ | 1404 #endif // VIEWS_VIEW_H_ |
OLD | NEW |