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

Unified Diff: trunk/src/ui/views/controls/menu/menu_controller.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/controls/menu/menu_controller.h ('k') | trunk/src/ui/views/view.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/ui/views/controls/menu/menu_controller.cc
===================================================================
--- trunk/src/ui/views/controls/menu/menu_controller.cc (revision 192531)
+++ trunk/src/ui/views/controls/menu/menu_controller.cc (working copy)
@@ -53,11 +53,6 @@
// that the finger does not obscure the menu.
static const int kCenteredContextMenuYOffset = -15;
-// When showing context menu on mouse down, the user might accidentally select
-// the menu item on the subsequent mouse up. To prevent this, we add the
-// following delay before the user is able to select an item.
-static const int kContextMenuSelectionHoldTimeMs = 200;
-
namespace views {
namespace {
@@ -291,14 +286,7 @@
possible_drag_ = false;
drag_in_progress_ = false;
closing_event_time_ = base::TimeDelta();
- menu_start_time_ = base::TimeTicks::Now();
- // If we are shown on mouse press, we will eat the subsequent mouse down and
- // the parent widget will not be able to reset its state (it might have mouse
- // capture from the mouse down). So we clear its state here.
- if (parent && parent->GetRootView())
- parent->GetRootView()->SetMouseHandler(NULL);
-
bool nested_menu = showing_;
if (showing_) {
// Only support nesting of blocking_run menus, nesting of
@@ -508,11 +496,7 @@
}
if (!part.menu->NonIconChildViewsCount() &&
part.menu->GetDelegate()->IsTriggerableEvent(part.menu, event)) {
- int64 time_since_menu_start =
- (base::TimeTicks::Now() - menu_start_time_).InMilliseconds();
- if (!state_.context_menu || !View::ShouldShowContextMenuOnMousePress() ||
- time_since_menu_start > kContextMenuSelectionHoldTimeMs)
- Accept(part.menu, event.flags());
+ Accept(part.menu, event.flags());
return;
}
} else if (part.type == MenuPart::MENU_ITEM) {
@@ -1109,8 +1093,7 @@
delegate_(delegate),
message_loop_depth_(0),
menu_config_(theme),
- closing_event_time_(base::TimeDelta()),
- menu_start_time_(base::TimeTicks()) {
+ closing_event_time_(base::TimeDelta()) {
active_instance_ = this;
}
« no previous file with comments | « trunk/src/ui/views/controls/menu/menu_controller.h ('k') | trunk/src/ui/views/view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698