summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-07 17:14:23 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-07 17:14:23 +0000
commit8784578d7e13d112fd205d3ee4fc1fe0018beea0 (patch)
tree13cb5188f82350fef1c18ffe34951059609fafdb /views
parent70b1969691d983965f272d6fc05b252582fe0ee9 (diff)
downloadchromium_src-8784578d7e13d112fd205d3ee4fc1fe0018beea0.zip
chromium_src-8784578d7e13d112fd205d3ee4fc1fe0018beea0.tar.gz
chromium_src-8784578d7e13d112fd205d3ee4fc1fe0018beea0.tar.bz2
MessageBubble which does not require separate window and does not grab input on mouse press event.
* Added new constructor to InfoBubble for chromeos which takes WidgetGtk::Type parameter * Made DoGrab/HandleGrabBroke so that subclass can customize its behavior. * Added MessageBubble::ShowNoGrab that shows a child MessageBubble which does not grab input on mouse press event. * Explicitly remove accelerator when closed. This is necessary for child, but doing for all case as it's harmless to do so. * Moved HandleGrabBroke to protected and made virtual so that sub class can trap the event. ScreenLocker will use this event to detect this. This will be used for screen locker. BUG=none TEST=none Review URL: http://codereview.chromium.org/2682004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49068 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/widget/widget_gtk.cc18
-rw-r--r--views/widget/widget_gtk.h9
2 files changed, 14 insertions, 13 deletions
diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc
index 78137c5..5d946f5 100644
--- a/views/widget/widget_gtk.cc
+++ b/views/widget/widget_gtk.cc
@@ -1153,6 +1153,15 @@ void WidgetGtk::ReleaseGrab() {
}
}
+void WidgetGtk::HandleGrabBroke() {
+ if (has_capture_) {
+ if (is_mouse_down_)
+ root_view_->ProcessMouseDragCanceled();
+ is_mouse_down_ = false;
+ has_capture_ = false;
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
// WidgetGtk, private:
@@ -1399,15 +1408,6 @@ void WidgetGtk::ConfigureWidgetForIgnoreEvents() {
0);
}
-void WidgetGtk::HandleGrabBroke() {
- if (has_capture_) {
- if (is_mouse_down_)
- root_view_->ProcessMouseDragCanceled();
- is_mouse_down_ = false;
- has_capture_ = false;
- }
-}
-
void WidgetGtk::DrawTransparentBackground(GtkWidget* widget,
GdkEventExpose* event) {
cairo_t* cr = gdk_cairo_create(widget->window);
diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h
index beb629f..8f7ca17 100644
--- a/views/widget/widget_gtk.h
+++ b/views/widget/widget_gtk.h
@@ -270,11 +270,15 @@ class WidgetGtk
virtual bool ReleaseCaptureOnMouseReleased() { return true; }
// Does a mouse grab on this widget.
- void DoGrab();
+ virtual void DoGrab();
// Releases a grab done by this widget.
virtual void ReleaseGrab();
+ // Invoked when input grab is stolen by other GtkWidget in the same
+ // application.
+ virtual void HandleGrabBroke();
+
// Are we a subclass of WindowGtk?
bool is_window_;
@@ -316,9 +320,6 @@ class WidgetGtk
// MakeIgnoreEvents has been invoked.
void ConfigureWidgetForIgnoreEvents();
- // TODO(sky): documentation
- void HandleGrabBroke();
-
// A utility function to draw a transparent background onto the |widget|.
static void DrawTransparentBackground(GtkWidget* widget,
GdkEventExpose* event);