summaryrefslogtreecommitdiffstats
path: root/ui/views/controls
diff options
context:
space:
mode:
authortdresser@chromium.org <tdresser@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-11 17:10:46 +0000
committertdresser@chromium.org <tdresser@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-11 17:10:46 +0000
commite3d5088818a8bce126d6b8be02a2852293230d31 (patch)
treef65716b8fd7e0207d2dd4ce62fe8f3f5e5f362cd /ui/views/controls
parent7201d8a61391d00c02b83c1e970705f45fa91219 (diff)
downloadchromium_src-e3d5088818a8bce126d6b8be02a2852293230d31.zip
chromium_src-e3d5088818a8bce126d6b8be02a2852293230d31.tar.gz
chromium_src-e3d5088818a8bce126d6b8be02a2852293230d31.tar.bz2
Mouse events, touch events, or both can be locked to a target.
NativeWidgetPrivate and Window event capture related commands now take a set of flags, indicating what event types to lock. Current options are CW_LOCK_MOUSE and CW_LOCK_TOUCH. BUG=117554 TEST=WindowTest.TouchCaptureTests, WindowTest.CaptureTests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=131761 Review URL: http://codereview.chromium.org/9838011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@131783 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views/controls')
-rw-r--r--ui/views/controls/menu/menu_host.cc9
1 files changed, 5 insertions, 4 deletions
diff --git a/ui/views/controls/menu/menu_host.cc b/ui/views/controls/menu/menu_host.cc
index 701056f..23060d7 100644
--- a/ui/views/controls/menu/menu_host.cc
+++ b/ui/views/controls/menu/menu_host.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -49,7 +49,7 @@ void MenuHost::ShowMenuHost(bool do_capture) {
ignore_capture_lost_ = true;
Show();
if (do_capture)
- native_widget_private()->SetMouseCapture();
+ native_widget_private()->SetCapture(ui::CW_LOCK_MOUSE | ui::CW_LOCK_TOUCH);
ignore_capture_lost_ = false;
}
@@ -72,8 +72,9 @@ void MenuHost::SetMenuHostBounds(const gfx::Rect& bounds) {
}
void MenuHost::ReleaseMenuHostCapture() {
- if (native_widget_private()->HasMouseCapture())
- native_widget_private()->ReleaseMouseCapture();
+ if (native_widget_private()->HasCapture(ui::CW_LOCK_MOUSE) ||
+ native_widget_private()->HasCapture(ui::CW_LOCK_TOUCH))
+ native_widget_private()->ReleaseCapture();
}
////////////////////////////////////////////////////////////////////////////////