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

Unified Diff: trunk/src/ui/views/view.cc

Issue 13565004: Revert 192525 "Context menu on views must show on mouse down for..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « trunk/src/ui/views/view.h ('k') | trunk/src/ui/views/widget/widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/views/view.cc
===================================================================
--- trunk/src/ui/views/view.cc (revision 192531)
+++ trunk/src/ui/views/view.cc (working copy)
@@ -57,12 +57,6 @@
bool use_acceleration_when_possible = false;
#endif
-#if defined(OS_WIN)
-const bool kContextMenuOnMousePress = false;
-#else
-const bool kContextMenuOnMousePress = true;
-#endif
-
// Saves the drawing state, and restores the state when going out of scope.
class ScopedCanvas {
public:
@@ -1136,11 +1130,6 @@
context_menu_controller_->ShowContextMenuForView(this, p);
}
-// static
-bool View::ShouldShowContextMenuOnMousePress() {
- return kContextMenuOnMousePress;
-}
-
// Drag and drop ---------------------------------------------------------------
bool View::GetDropFormats(
@@ -2071,29 +2060,16 @@
GetDragOperations(event.location()) : 0;
ContextMenuController* context_menu_controller = event.IsRightMouseButton() ?
context_menu_controller_ : 0;
- View::DragInfo* drag_info = GetDragInfo();
const bool enabled = enabled_;
const bool result = OnMousePressed(event);
+ // WARNING: we may have been deleted, don't use any View variables.
if (!enabled)
return result;
- if (event.IsOnlyRightMouseButton() && context_menu_controller &&
- kContextMenuOnMousePress) {
- // Assume that if there is a context menu controller we won't be deleted
- // from mouse pressed.
- gfx::Point location(event.location());
- if (HitTestPoint(location)) {
- ConvertPointToScreen(this, &location);
- ShowContextMenu(location, true);
- return true;
- }
- }
-
- // WARNING: we may have been deleted, don't use any View variables.
if (drag_operations != ui::DragDropTypes::DRAG_NONE) {
- drag_info->PossibleDrag(event.location());
+ GetDragInfo()->PossibleDrag(event.location());
return true;
}
return !!context_menu_controller || result;
@@ -2122,8 +2098,7 @@
}
void View::ProcessMouseReleased(const ui::MouseEvent& event) {
- if (!kContextMenuOnMousePress && context_menu_controller_ &&
- event.IsOnlyRightMouseButton()) {
+ if (context_menu_controller_ && event.IsOnlyRightMouseButton()) {
// Assume that if there is a context menu controller we won't be deleted
// from mouse released.
gfx::Point location(event.location());
« no previous file with comments | « trunk/src/ui/views/view.h ('k') | trunk/src/ui/views/widget/widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698