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 #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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
784 } | 784 } |
785 | 785 |
786 // Provides default implementation for context menu handling. The default | 786 // Provides default implementation for context menu handling. The default |
787 // implementation calls the ShowContextMenu of the current | 787 // implementation calls the ShowContextMenu of the current |
788 // ContextMenuController (if it is not NULL). Overridden in subclassed views | 788 // ContextMenuController (if it is not NULL). Overridden in subclassed views |
789 // to provide right-click menu display triggerd by the keyboard (i.e. for the | 789 // to provide right-click menu display triggerd by the keyboard (i.e. for the |
790 // Chrome toolbar Back and Forward buttons). No source needs to be specified, | 790 // Chrome toolbar Back and Forward buttons). No source needs to be specified, |
791 // as it is always equal to the current View. | 791 // as it is always equal to the current View. |
792 virtual void ShowContextMenu(const gfx::Point& p, bool is_mouse_gesture); | 792 virtual void ShowContextMenu(const gfx::Point& p, bool is_mouse_gesture); |
793 | 793 |
| 794 // On some platforms, we show context menu on mouse press instead of release. |
| 795 // This method returns true for those platforms. |
| 796 static bool ShouldShowContextMenuOnMousePress(); |
| 797 |
794 // Drag and drop ------------------------------------------------------------- | 798 // Drag and drop ------------------------------------------------------------- |
795 | 799 |
796 DragController* drag_controller() { return drag_controller_; } | 800 DragController* drag_controller() { return drag_controller_; } |
797 void set_drag_controller(DragController* drag_controller) { | 801 void set_drag_controller(DragController* drag_controller) { |
798 drag_controller_ = drag_controller; | 802 drag_controller_ = drag_controller; |
799 } | 803 } |
800 | 804 |
801 // During a drag and drop session when the mouse moves the view under the | 805 // During a drag and drop session when the mouse moves the view under the |
802 // mouse is queried for the drop types it supports by way of the | 806 // mouse is queried for the drop types it supports by way of the |
803 // GetDropFormats methods. If the view returns true and the drag site can | 807 // GetDropFormats methods. If the view returns true and the drag site can |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1495 // Belongs to this view, but it's reference-counted on some platforms | 1499 // Belongs to this view, but it's reference-counted on some platforms |
1496 // so we can't use a scoped_ptr. It's dereferenced in the destructor. | 1500 // so we can't use a scoped_ptr. It's dereferenced in the destructor. |
1497 NativeViewAccessibility* native_view_accessibility_; | 1501 NativeViewAccessibility* native_view_accessibility_; |
1498 | 1502 |
1499 DISALLOW_COPY_AND_ASSIGN(View); | 1503 DISALLOW_COPY_AND_ASSIGN(View); |
1500 }; | 1504 }; |
1501 | 1505 |
1502 } // namespace views | 1506 } // namespace views |
1503 | 1507 |
1504 #endif // UI_VIEWS_VIEW_H_ | 1508 #endif // UI_VIEWS_VIEW_H_ |
OLD | NEW |