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

Side by Side Diff: chrome/browser/ui/views/tabs/tab_drag_controller.cc

Issue 1987343002: Drag and drop cleans up touch sequences from the source window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/tabs/tab_drag_controller.h" 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
592 592
593 if (!target_tabstrip) { 593 if (!target_tabstrip) {
594 DetachIntoNewBrowserAndRunMoveLoop(point_in_screen); 594 DetachIntoNewBrowserAndRunMoveLoop(point_in_screen);
595 return DRAG_BROWSER_RESULT_STOP; 595 return DRAG_BROWSER_RESULT_STOP;
596 } 596 }
597 597
598 #if defined(USE_AURA) 598 #if defined(USE_AURA)
599 // Only Aura windows are gesture consumers. 599 // Only Aura windows are gesture consumers.
600 ui::GestureRecognizer::Get()->TransferEventsTo( 600 ui::GestureRecognizer::Get()->TransferEventsTo(
601 GetAttachedBrowserWidget()->GetNativeView(), 601 GetAttachedBrowserWidget()->GetNativeView(),
602 target_tabstrip->GetWidget()->GetNativeView()); 602 target_tabstrip->GetWidget()->GetNativeView(),
603 ui::GestureRecognizer::ShouldCancelTouches::DontCancel);
603 #endif 604 #endif
604 605
605 if (is_dragging_window_) { 606 if (is_dragging_window_) {
606 // ReleaseCapture() is going to result in calling back to us (because it 607 // ReleaseCapture() is going to result in calling back to us (because it
607 // results in a move). That'll cause all sorts of problems. Reset the 608 // results in a move). That'll cause all sorts of problems. Reset the
608 // observer so we don't get notified and process the event. 609 // observer so we don't get notified and process the event.
609 #if defined(USE_ASH) 610 #if defined(USE_ASH)
610 move_loop_widget_->RemoveObserver(this); 611 move_loop_widget_->RemoveObserver(this);
611 move_loop_widget_ = nullptr; 612 move_loop_widget_ = nullptr;
612 #endif // USE_ASH 613 #endif // USE_ASH
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 1048
1048 BrowserView* dragged_browser_view = 1049 BrowserView* dragged_browser_view =
1049 BrowserView::GetBrowserViewForBrowser(browser); 1050 BrowserView::GetBrowserViewForBrowser(browser);
1050 views::Widget* dragged_widget = dragged_browser_view->GetWidget(); 1051 views::Widget* dragged_widget = dragged_browser_view->GetWidget();
1051 1052
1052 #if defined(USE_AURA) 1053 #if defined(USE_AURA)
1053 // Only Aura windows are gesture consumers. 1054 // Only Aura windows are gesture consumers.
1054 gfx::NativeView attached_native_view = 1055 gfx::NativeView attached_native_view =
1055 attached_tabstrip_->GetWidget()->GetNativeView(); 1056 attached_tabstrip_->GetWidget()->GetNativeView();
1056 ui::GestureRecognizer::Get()->TransferEventsTo( 1057 ui::GestureRecognizer::Get()->TransferEventsTo(
1057 attached_native_view, dragged_widget->GetNativeView()); 1058 attached_native_view, dragged_widget->GetNativeView(),
1059 ui::GestureRecognizer::ShouldCancelTouches::DontCancel);
1058 #endif 1060 #endif
1059 1061
1060 Detach(can_release_capture_ ? RELEASE_CAPTURE : DONT_RELEASE_CAPTURE); 1062 Detach(can_release_capture_ ? RELEASE_CAPTURE : DONT_RELEASE_CAPTURE);
1061 1063
1062 dragged_widget->SetVisibilityChangedAnimationsEnabled(false); 1064 dragged_widget->SetVisibilityChangedAnimationsEnabled(false);
1063 Attach(dragged_browser_view->tabstrip(), gfx::Point()); 1065 Attach(dragged_browser_view->tabstrip(), gfx::Point());
1064 AdjustBrowserAndTabBoundsForDrag(last_tabstrip_width, 1066 AdjustBrowserAndTabBoundsForDrag(last_tabstrip_width,
1065 point_in_screen, 1067 point_in_screen,
1066 &drag_bounds); 1068 &drag_bounds);
1067 WindowPositionManagedUpdater updater; 1069 WindowPositionManagedUpdater updater;
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after
1823 // TODO(pkotwicz): Fix this properly (crbug.com/358482) 1825 // TODO(pkotwicz): Fix this properly (crbug.com/358482)
1824 for (auto* browser : *BrowserList::GetInstance()) { 1826 for (auto* browser : *BrowserList::GetInstance()) {
1825 if (browser->tab_strip_model()->empty()) 1827 if (browser->tab_strip_model()->empty())
1826 exclude.insert(browser->window()->GetNativeWindow()); 1828 exclude.insert(browser->window()->GetNativeWindow());
1827 } 1829 }
1828 #endif 1830 #endif
1829 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); 1831 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr());
1830 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude); 1832 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude);
1831 return ref ? Liveness::ALIVE : Liveness::DELETED; 1833 return ref ? Liveness::ALIVE : Liveness::DELETED;
1832 } 1834 }
OLDNEW
« no previous file with comments | « ash/shelf/shelf_tooltip_manager_unittest.cc ('k') | ui/aura/gestures/gesture_recognizer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698