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

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

Issue 10828133: Desktop Aura: Allow tab drags out of window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better mouse tracking Created 8 years, 4 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: chrome/browser/ui/views/tabs/tab_drag_controller.h
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.h b/chrome/browser/ui/views/tabs/tab_drag_controller.h
index dd9f68dc2789890ea6ecff5df6290b9bb7c44b8b..cfdc5169ab4b4cb8fcebf12edf9638831cb272ce 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.h
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.h
@@ -321,7 +321,7 @@ class TabDragController : public content::WebContentsDelegate,
void DetachIntoNewBrowserAndRunMoveLoop(const gfx::Point& point_in_screen);
// Runs a nested message loop that handles moving the current Browser.
- void RunMoveLoop();
+ void RunMoveLoop(const gfx::Point& drag_offset);
// Determines the index to insert tabs at. |dragged_bounds| is the bounds of
// the tabs being dragged, |start| the index of the tab to start looking from
@@ -428,6 +428,7 @@ class TabDragController : public content::WebContentsDelegate,
// Creates and returns a new Browser to handle the drag.
Browser* CreateBrowserForDrag(TabStrip* source,
const gfx::Point& point_in_screen,
+ gfx::Point* drag_offset,
std::vector<gfx::Rect>* drag_bounds);
// Returns the TabStripModel for the specified tabstrip.
@@ -437,6 +438,10 @@ class TabDragController : public content::WebContentsDelegate,
// mouse or the location of the current touch point.
gfx::Point GetCursorScreenPoint();
+ // Returns the offset from the top left corner of the window to
+ // |point_in_screen|.
+ gfx::Point GetWindowOffset(const gfx::Point& point_in_screen);
+
// Returns true if moving the mouse only changes the visible tabs.
bool move_only() const {
return (move_behavior_ == MOVE_VISIBILE_TABS) != 0;
@@ -469,6 +474,8 @@ class TabDragController : public content::WebContentsDelegate,
// detached window is created at the right location.
gfx::Point mouse_offset_;
+ gfx::Point window_mouse_offset_;
+
// Offset of the mouse relative to the source tab.
int source_tab_offset_;

Powered by Google App Engine
This is Rietveld 408576698