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

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

Issue 12529012: Context menu on views must show on mouse down for non-WIN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 8 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 772 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
793 // Drag and drop ------------------------------------------------------------- 797 // Drag and drop -------------------------------------------------------------
794 798
795 DragController* drag_controller() { return drag_controller_; } 799 DragController* drag_controller() { return drag_controller_; }
796 void set_drag_controller(DragController* drag_controller) { 800 void set_drag_controller(DragController* drag_controller) {
797 drag_controller_ = drag_controller; 801 drag_controller_ = drag_controller;
798 } 802 }
799 803
800 // During a drag and drop session when the mouse moves the view under the 804 // During a drag and drop session when the mouse moves the view under the
801 // mouse is queried for the drop types it supports by way of the 805 // mouse is queried for the drop types it supports by way of the
802 // GetDropFormats methods. If the view returns true and the drag site can 806 // GetDropFormats methods. If the view returns true and the drag site can
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after
1494 // Belongs to this view, but it's reference-counted on some platforms 1498 // Belongs to this view, but it's reference-counted on some platforms
1495 // so we can't use a scoped_ptr. It's dereferenced in the destructor. 1499 // so we can't use a scoped_ptr. It's dereferenced in the destructor.
1496 NativeViewAccessibility* native_view_accessibility_; 1500 NativeViewAccessibility* native_view_accessibility_;
1497 1501
1498 DISALLOW_COPY_AND_ASSIGN(View); 1502 DISALLOW_COPY_AND_ASSIGN(View);
1499 }; 1503 };
1500 1504
1501 } // namespace views 1505 } // namespace views
1502 1506
1503 #endif // UI_VIEWS_VIEW_H_ 1507 #endif // UI_VIEWS_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698