Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(834)

Unified Diff: ui/views/widget/widget.cc

Issue 23533030: rAc: Enforce a 3 second grace period for generated card bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add a test Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/widget/widget.cc
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index 4bf2a850f05b01e105f8afe61e534f34ea5077da..7efb8cd9a7b4939ea6aed0e53c3cae08a033f860 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -173,6 +173,7 @@ Widget::Widget()
is_mouse_button_pressed_(false),
is_touch_down_(false),
last_mouse_event_was_move_(false),
+ auto_release_capture_(true),
root_layers_dirty_(false),
movement_disabled_(false) {
}
@@ -1160,10 +1161,8 @@ void Widget::OnMouseEvent(ui::MouseEvent* event) {
last_mouse_event_was_move_ = false;
is_mouse_button_pressed_ = false;
// Release capture first, to avoid confusion if OnMouseReleased blocks.
- if (native_widget_->HasCapture() &&
- ShouldReleaseCaptureOnMouseReleased()) {
+ if (auto_release_capture_ && native_widget_->HasCapture())
native_widget_->ReleaseCapture();
- }
if (root_view)
root_view->OnMouseReleased(*event);
if ((event->flags() & ui::EF_IS_NON_CLIENT) == 0)
@@ -1231,7 +1230,7 @@ void Widget::OnGestureEvent(ui::GestureEvent* event) {
case ui::ET_GESTURE_END:
if (event->details().touch_points() == 1) {
is_touch_down_ = false;
- if (ShouldReleaseCaptureOnMouseReleased())
+ if (auto_release_capture_)
ReleaseCapture();
}
break;
@@ -1314,10 +1313,6 @@ void Widget::DestroyRootView() {
////////////////////////////////////////////////////////////////////////////////
// Widget, private:
-bool Widget::ShouldReleaseCaptureOnMouseReleased() const {
- return true;
-}
-
void Widget::SetInactiveRenderingDisabled(bool value) {
if (value == disable_inactive_rendering_)
return;

Powered by Google App Engine
This is Rietveld 408576698