summaryrefslogtreecommitdiffstats
path: root/views/controls
diff options
context:
space:
mode:
authormsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-31 20:38:03 +0000
committermsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-31 20:38:03 +0000
commit66e5af67ff42c6db608aad2bc87393c468c8a642 (patch)
tree7ba907d99e1c86e0680ef8e4282cc9973a2d36bd /views/controls
parent5332b834259dbab2ebbefba1944824df469139d4 (diff)
downloadchromium_src-66e5af67ff42c6db608aad2bc87393c468c8a642.zip
chromium_src-66e5af67ff42c6db608aad2bc87393c468c8a642.tar.gz
chromium_src-66e5af67ff42c6db608aad2bc87393c468c8a642.tar.bz2
Consolidate Widget Event code, other cleanup.
Rename *NativeCapture to *MouseCapture. Rename and move ShouldReleaseCaptureOnMouseReleased. Move static flag function to Event. BUG=72040 TEST=Mouse interaction on win & linux_views. Review URL: http://codereview.chromium.org/6756043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls')
-rw-r--r--views/controls/menu/menu_host_gtk.cc12
-rw-r--r--views/controls/menu/menu_host_gtk.h4
-rw-r--r--views/controls/menu/menu_host_win.cc4
-rw-r--r--views/controls/menu/menu_host_win.h3
4 files changed, 11 insertions, 12 deletions
diff --git a/views/controls/menu/menu_host_gtk.cc b/views/controls/menu/menu_host_gtk.cc
index 9ec992b9..0f4dfc7 100644
--- a/views/controls/menu/menu_host_gtk.cc
+++ b/views/controls/menu/menu_host_gtk.cc
@@ -89,7 +89,7 @@ void MenuHostGtk::SetMenuHostBounds(const gfx::Rect& bounds) {
}
void MenuHostGtk::ReleaseMenuHostCapture() {
- ReleaseNativeCapture();
+ ReleaseMouseCapture();
}
gfx::NativeWindow MenuHostGtk::GetMenuHostWindow() {
@@ -103,12 +103,12 @@ RootView* MenuHostGtk::CreateRootView() {
return new MenuHostRootView(this, submenu_);
}
-bool MenuHostGtk::ReleaseCaptureOnMouseReleased() {
+bool MenuHostGtk::ShouldReleaseCaptureOnMouseReleased() const {
return false;
}
-void MenuHostGtk::ReleaseNativeCapture() {
- WidgetGtk::ReleaseNativeCapture();
+void MenuHostGtk::ReleaseMouseCapture() {
+ WidgetGtk::ReleaseMouseCapture();
if (did_input_grab_) {
did_input_grab_ = false;
gdk_pointer_ungrab(GDK_CURRENT_TIME);
@@ -142,7 +142,7 @@ void MenuHostGtk::HandleXGrabBroke() {
void MenuHostGtk::HandleGtkGrabBroke() {
// Grab can be broken by drag & drop, other menu or screen locker.
if (did_input_grab_ && !destroying_) {
- ReleaseNativeCapture();
+ ReleaseMouseCapture();
CancelAllIfNoDrag();
}
WidgetGtk::HandleGtkGrabBroke();
@@ -160,7 +160,7 @@ void MenuHostGtk::DoCapture() {
gtk_grab_remove(current_grab_window);
// Make sure all app mouse/keyboard events are targetted at us only.
- SetNativeCapture();
+ SetMouseCapture();
// And do a grab. NOTE: we do this to ensure we get mouse/keyboard
// events from other apps, a grab done with gtk_grab_add doesn't get
diff --git a/views/controls/menu/menu_host_gtk.h b/views/controls/menu/menu_host_gtk.h
index e0e56d0..f25d52c 100644
--- a/views/controls/menu/menu_host_gtk.h
+++ b/views/controls/menu/menu_host_gtk.h
@@ -37,8 +37,8 @@ class MenuHostGtk : public WidgetGtk,
// Overridden from WidgetGtk:
virtual RootView* CreateRootView() OVERRIDE;
- virtual bool ReleaseCaptureOnMouseReleased() OVERRIDE;
- virtual void ReleaseNativeCapture() OVERRIDE;
+ virtual bool ShouldReleaseCaptureOnMouseReleased() const OVERRIDE;
+ virtual void ReleaseMouseCapture() OVERRIDE;
virtual void OnDestroy(GtkWidget* object) OVERRIDE;
virtual void HandleGtkGrabBroke() OVERRIDE;
virtual void HandleXGrabBroke() OVERRIDE;
diff --git a/views/controls/menu/menu_host_win.cc b/views/controls/menu/menu_host_win.cc
index 906dda5..0392a34 100644
--- a/views/controls/menu/menu_host_win.cc
+++ b/views/controls/menu/menu_host_win.cc
@@ -107,7 +107,7 @@ RootView* MenuHostWin::CreateRootView() {
return new MenuHostRootView(this, submenu_);
}
-bool MenuHostWin::ReleaseCaptureOnMouseReleased() {
+bool MenuHostWin::ShouldReleaseCaptureOnMouseReleased() const {
return false;
}
@@ -116,7 +116,7 @@ bool MenuHostWin::ReleaseCaptureOnMouseReleased() {
void MenuHostWin::DoCapture() {
owns_capture_ = true;
- SetNativeCapture();
+ SetMouseCapture();
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/views/controls/menu/menu_host_win.h b/views/controls/menu/menu_host_win.h
index 2300aab..f605275 100644
--- a/views/controls/menu/menu_host_win.h
+++ b/views/controls/menu/menu_host_win.h
@@ -2,7 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-
#ifndef VIEWS_CONTROLS_MENU_MENU_HOST_WIN_H_
#define VIEWS_CONTROLS_MENU_MENU_HOST_WIN_H_
#pragma once
@@ -40,7 +39,7 @@ class MenuHostWin : public WidgetWin,
virtual void OnCaptureChanged(HWND hwnd) OVERRIDE;
virtual void OnCancelMode() OVERRIDE;
virtual RootView* CreateRootView() OVERRIDE;
- virtual bool ReleaseCaptureOnMouseReleased() OVERRIDE;
+ virtual bool ShouldReleaseCaptureOnMouseReleased() const OVERRIDE;
void DoCapture();