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