summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-11 23:46:58 +0000
committerscottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-11 23:46:58 +0000
commit81526fce5605e7afd3c71fe49d9ca0eae432d41c (patch)
tree670afcafa3042f1acd48d3521dac967f32f724cc /ui
parentf2d5f5b60f7acc3cdb07b0d5f7a0eef469dc6080 (diff)
downloadchromium_src-81526fce5605e7afd3c71fe49d9ca0eae432d41c.zip
chromium_src-81526fce5605e7afd3c71fe49d9ca0eae432d41c.tar.gz
chromium_src-81526fce5605e7afd3c71fe49d9ca0eae432d41c.tar.bz2
Use the windows path for reposting menu events on win aura
On non-Aura, the behaviour is that when the menu is open, presses outside of the menu (say, to start a tab drag, or to click "new tab") both dismiss the menu and perform the mouse press action. This changes win aura to match win non-aura. BUG=229983 Review URL: https://chromiumcodereview.appspot.com/14029019 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193804 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/views/controls/menu/menu_controller.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index a27e99a..d849ac0b 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -35,6 +35,10 @@
#include "ui/aura/window.h"
#endif
+#if defined(OS_WIN)
+#include "ui/views/win/hwnd_util.h"
+#endif
+
#if defined(USE_X11)
#include <X11/Xlib.h>
#endif
@@ -847,7 +851,7 @@ void MenuController::SetSelectionOnPointerDown(SubmenuView* source,
// Mouse wasn't pressed over any menu, or the active menu, cancel.
-#if defined(OS_WIN) && !defined(USE_AURA)
+#if defined(OS_WIN)
// We're going to close and we own the mouse capture. We need to repost the
// mouse down, otherwise the window the user clicked on won't get the
// event.
@@ -868,7 +872,7 @@ void MenuController::SetSelectionOnPointerDown(SubmenuView* source,
}
Cancel(exit_type);
-#if defined(USE_AURA)
+#if defined(USE_AURA) && !defined(OS_WIN)
// We're going to exit the menu and want to repost the event so that is
// is handled normally after the context menu has exited. We call
// RepostEvent after Cancel so that mouse capture has been released so
@@ -2049,7 +2053,7 @@ bool MenuController::SelectByChar(char16 character) {
return false;
}
-#if defined(OS_WIN) && !defined(USE_AURA)
+#if defined(OS_WIN)
void MenuController::RepostEvent(SubmenuView* source,
const ui::LocatedEvent& event) {
if (!state_.item) {
@@ -2069,8 +2073,9 @@ void MenuController::RepostEvent(SubmenuView* source,
submenu->ReleaseCapture();
if (submenu->GetWidget()->GetNativeView() &&
- GetWindowThreadProcessId(submenu->GetWidget()->GetNativeView(), NULL) !=
- GetWindowThreadProcessId(window, NULL)) {
+ GetWindowThreadProcessId(
+ views::HWNDForNativeView(submenu->GetWidget()->GetNativeView()),
+ NULL) != GetWindowThreadProcessId(window, NULL)) {
// Even though we have mouse capture, windows generates a mouse event
// if the other window is in a separate thread. Don't generate an event in
// this case else the target window can get double events leading to bad