diff options
author | skuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-16 18:06:08 +0000 |
---|---|---|
committer | skuhne@chromium.org <skuhne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-03-16 18:06:08 +0000 |
commit | eb3e52cf67792aede12fd4dcff42d6e9ff83686d (patch) | |
tree | d651cbbc72eafa86834f0e9a503e2116ef40db66 /ui/views | |
parent | 2189e09e6697118750bcf63852e147005a98a2b7 (diff) | |
download | chromium_src-eb3e52cf67792aede12fd4dcff42d6e9ff83686d.zip chromium_src-eb3e52cf67792aede12fd4dcff42d6e9ff83686d.tar.gz chromium_src-eb3e52cf67792aede12fd4dcff42d6e9ff83686d.tar.bz2 |
Revert 188538 "Closing menu from LauncherMenuItem upon second click"
> Closing menu from LauncherMenuItem upon second click
>
>
> BUG=181308
> TEST=visual
>
>
> Review URL: https://chromiumcodereview.appspot.com/12414008
TBR=skuhne@chromium.org
Review URL: https://codereview.chromium.org/12812017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188605 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/controls/menu/menu_controller.cc | 12 | ||||
-rw-r--r-- | ui/views/controls/menu/menu_controller.h | 6 | ||||
-rw-r--r-- | ui/views/controls/menu/menu_runner.cc | 21 | ||||
-rw-r--r-- | ui/views/controls/menu/menu_runner.h | 3 |
4 files changed, 3 insertions, 39 deletions
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc index 9b8db7d..c557479 100644 --- a/ui/views/controls/menu/menu_controller.cc +++ b/ui/views/controls/menu/menu_controller.cc @@ -285,7 +285,6 @@ MenuItemView* MenuController::Run(Widget* parent, exit_type_ = EXIT_NONE; possible_drag_ = false; drag_in_progress_ = false; - closing_event_time_ = base::TimeDelta(); bool nested_menu = showing_; if (showing_) { @@ -816,14 +815,6 @@ void MenuController::SetSelectionOnPointerDown(SubmenuView* source, if (part.type == MenuPart::NONE || (part.type == MenuPart::MENU_ITEM && part.menu && part.menu->GetRootMenuItem() != state_.item->GetRootMenuItem())) { - // Remember the time when we repost the event. The owner can then use this - // to figure out if this menu was finished with the same click which is - // sent to it thereafter. Note that the time stamp front he event cannot be - // used since the reposting will set a new timestamp when the event gets - // processed. As such it is better to take the current time which will be - // closer to the time when it arrives again in the menu handler. - closing_event_time_ = ui::EventTimeForNow(); - // Mouse wasn't pressed over any menu, or the active menu, cancel. #if defined(OS_WIN) && !defined(USE_AURA) @@ -1092,8 +1083,7 @@ MenuController::MenuController(ui::NativeTheme* theme, active_mouse_view_(NULL), delegate_(delegate), message_loop_depth_(0), - menu_config_(theme), - closing_event_time_(base::TimeDelta()) { + menu_config_(theme) { active_instance_ = this; } diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h index 6d2e5fb..38aeb9d 100644 --- a/ui/views/controls/menu/menu_controller.h +++ b/ui/views/controls/menu/menu_controller.h @@ -98,9 +98,6 @@ class VIEWS_EXPORT MenuController : public MessageLoop::Dispatcher, // the menu is being canceled. ExitType exit_type() const { return exit_type_; } - // Returns the time from the event which closed the menu - or 0. - base::TimeDelta closing_event_time() const { return closing_event_time_; } - // Various events, forwarded from the submenu. // // NOTE: the coordinates of the events are in that of the @@ -564,9 +561,6 @@ class VIEWS_EXPORT MenuController : public MessageLoop::Dispatcher, views::MenuConfig menu_config_; - // The timestamp of the event which closed the menu - or 0 otherwise. - base::TimeDelta closing_event_time_; - DISALLOW_COPY_AND_ASSIGN(MenuController); }; diff --git a/ui/views/controls/menu/menu_runner.cc b/ui/views/controls/menu/menu_runner.cc index 694503c..af2165b 100644 --- a/ui/views/controls/menu/menu_runner.cc +++ b/ui/views/controls/menu/menu_runner.cc @@ -75,9 +75,6 @@ class MenuRunnerImpl : public internal::MenuControllerDelegate { void Cancel(); - // Returns the time from the event which closed the menu - or 0. - base::TimeDelta closing_event_time() const; - // MenuControllerDelegate: virtual void DropMenuClosed(NotifyType type, MenuItemView* menu) OVERRIDE; virtual void SiblingMenuCreated(MenuItemView* menu) OVERRIDE; @@ -120,9 +117,6 @@ class MenuRunnerImpl : public internal::MenuControllerDelegate { // Do we own the controller? bool owns_controller_; - // The timestamp of the event which closed the menu - or 0. - base::TimeDelta closing_event_time_; - DISALLOW_COPY_AND_ASSIGN(MenuRunnerImpl); }; @@ -132,8 +126,7 @@ MenuRunnerImpl::MenuRunnerImpl(MenuItemView* menu) delete_after_run_(false), for_drop_(false), controller_(NULL), - owns_controller_(false), - closing_event_time_(base::TimeDelta()) { + owns_controller_(false) { } void MenuRunnerImpl::Release() { @@ -169,7 +162,6 @@ MenuRunner::RunResult MenuRunnerImpl::RunMenuAt( const gfx::Rect& bounds, MenuItemView::AnchorPosition anchor, int32 types) { - closing_event_time_ = base::TimeDelta(); if (running_) { // Ignore requests to show the menu while it's already showing. MenuItemView // doesn't handle this very well (meaning it crashes). @@ -221,8 +213,7 @@ MenuRunner::RunResult MenuRunnerImpl::RunMenuAt( MenuItemView* result = controller->Run(parent, button, menu_, bounds, anchor, (types & MenuRunner::CONTEXT_MENU) != 0, &mouse_event_flags); - // Get the time of the event which closed this menu. - closing_event_time_ = controller->closing_event_time(); + if (for_drop_) { // Drop menus return immediately. We finish processing in DropMenuClosed. return MenuRunner::NORMAL_EXIT; @@ -236,10 +227,6 @@ void MenuRunnerImpl::Cancel() { controller_->Cancel(MenuController::EXIT_ALL); } -base::TimeDelta MenuRunnerImpl::closing_event_time() const { - return closing_event_time_; -} - void MenuRunnerImpl::DropMenuClosed(NotifyType type, MenuItemView* menu) { MenuDone(NULL, 0); @@ -352,8 +339,4 @@ void MenuRunner::Cancel() { holder_->Cancel(); } -base::TimeDelta MenuRunner::closing_event_time() const { - return holder_->closing_event_time(); -} - } // namespace views diff --git a/ui/views/controls/menu/menu_runner.h b/ui/views/controls/menu/menu_runner.h index cd95c0a..7752708 100644 --- a/ui/views/controls/menu/menu_runner.h +++ b/ui/views/controls/menu/menu_runner.h @@ -96,9 +96,6 @@ class VIEWS_EXPORT MenuRunner { // Hides and cancels the menu. This does nothing if the menu is not open. void Cancel(); - // Returns the time from the event which closed the menu - or 0. - base::TimeDelta closing_event_time() const; - private: internal::MenuRunnerImpl* holder_; |