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

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

Issue 16979002: Add ContextMenuSourceType to views::ContextMenuController::ShowContextMenuForView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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
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 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
819 void set_context_menu_controller(ContextMenuController* menu_controller) { 819 void set_context_menu_controller(ContextMenuController* menu_controller) {
820 context_menu_controller_ = menu_controller; 820 context_menu_controller_ = menu_controller;
821 } 821 }
822 822
823 // Provides default implementation for context menu handling. The default 823 // Provides default implementation for context menu handling. The default
824 // implementation calls the ShowContextMenu of the current 824 // implementation calls the ShowContextMenu of the current
825 // ContextMenuController (if it is not NULL). Overridden in subclassed views 825 // ContextMenuController (if it is not NULL). Overridden in subclassed views
826 // to provide right-click menu display triggerd by the keyboard (i.e. for the 826 // to provide right-click menu display triggerd by the keyboard (i.e. for the
827 // Chrome toolbar Back and Forward buttons). No source needs to be specified, 827 // Chrome toolbar Back and Forward buttons). No source needs to be specified,
828 // as it is always equal to the current View. 828 // as it is always equal to the current View.
829 virtual void ShowContextMenu(const gfx::Point& p, bool is_mouse_gesture); 829 virtual void ShowContextMenu(const gfx::Point& p,
830 ui::ContextMenuSourceType source_type);
830 831
831 // On some platforms, we show context menu on mouse press instead of release. 832 // On some platforms, we show context menu on mouse press instead of release.
832 // This method returns true for those platforms. 833 // This method returns true for those platforms.
833 static bool ShouldShowContextMenuOnMousePress(); 834 static bool ShouldShowContextMenuOnMousePress();
834 835
835 // Drag and drop ------------------------------------------------------------- 836 // Drag and drop -------------------------------------------------------------
836 837
837 DragController* drag_controller() { return drag_controller_; } 838 DragController* drag_controller() { return drag_controller_; }
838 void set_drag_controller(DragController* drag_controller) { 839 void set_drag_controller(DragController* drag_controller) {
839 drag_controller_ = drag_controller; 840 drag_controller_ = drag_controller;
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1542 // Belongs to this view, but it's reference-counted on some platforms 1543 // Belongs to this view, but it's reference-counted on some platforms
1543 // so we can't use a scoped_ptr. It's dereferenced in the destructor. 1544 // so we can't use a scoped_ptr. It's dereferenced in the destructor.
1544 NativeViewAccessibility* native_view_accessibility_; 1545 NativeViewAccessibility* native_view_accessibility_;
1545 1546
1546 DISALLOW_COPY_AND_ASSIGN(View); 1547 DISALLOW_COPY_AND_ASSIGN(View);
1547 }; 1548 };
1548 1549
1549 } // namespace views 1550 } // namespace views
1550 1551
1551 #endif // UI_VIEWS_VIEW_H_ 1552 #endif // UI_VIEWS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698