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

Unified Diff: chrome/browser/ui/views/tabs/tab_drag_controller.cc

Issue 143153004: [Reland] Fix crash when accidentally touching the screen during a multi window resize (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/tabs/tab_drag_controller.cc
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
index 0e9c18d48f47ed53bd6e695388c6daf67fa3e717..658079119936d5461dfc62a5829bd4a95cbf95cb 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -437,6 +437,12 @@ TabDragController::~TabDragController() {
// if the drag was completed.
if (!detach_into_browser_)
ResetDelegates();
+
+ if (event_source_ == EVENT_SOURCE_TOUCH) {
+ TabStrip* capture_tabstrip = (attached_tabstrip_ && detach_into_browser_) ?
+ attached_tabstrip_ : source_tabstrip_;
+ capture_tabstrip->GetWidget()->ReleaseCapture();
+ }
}
void TabDragController::Init(
@@ -489,6 +495,11 @@ void TabDragController::Init(
}
InitWindowCreatePoint();
initial_selection_model_.Copy(initial_selection_model);
+
+ // Gestures don't automatically do a capture. We don't allow multiple drags at
+ // the same time, so we explicitly capture.
+ if (event_source == EVENT_SOURCE_TOUCH)
+ source_tabstrip_->GetWidget()->SetCapture(source_tabstrip_);
}
// static
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698