OLD | NEW |
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 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 void Attach(TabStrip* attached_tabstrip, const gfx::Point& point_in_screen); | 314 void Attach(TabStrip* attached_tabstrip, const gfx::Point& point_in_screen); |
315 | 315 |
316 // Detach the dragged Tab from the current TabStrip. | 316 // Detach the dragged Tab from the current TabStrip. |
317 void Detach(ReleaseCapture release_capture); | 317 void Detach(ReleaseCapture release_capture); |
318 | 318 |
319 // Detaches the tabs being dragged, creates a new Browser to contain them and | 319 // Detaches the tabs being dragged, creates a new Browser to contain them and |
320 // runs a nested move loop. | 320 // runs a nested move loop. |
321 void DetachIntoNewBrowserAndRunMoveLoop(const gfx::Point& point_in_screen); | 321 void DetachIntoNewBrowserAndRunMoveLoop(const gfx::Point& point_in_screen); |
322 | 322 |
323 // Runs a nested message loop that handles moving the current Browser. | 323 // Runs a nested message loop that handles moving the current Browser. |
324 void RunMoveLoop(); | 324 void RunMoveLoop(const gfx::Point& drag_offset); |
325 | 325 |
326 // Determines the index to insert tabs at. |dragged_bounds| is the bounds of | 326 // Determines the index to insert tabs at. |dragged_bounds| is the bounds of |
327 // the tabs being dragged, |start| the index of the tab to start looking from | 327 // the tabs being dragged, |start| the index of the tab to start looking from |
328 // and |delta| the amount to increment (1 or -1). | 328 // and |delta| the amount to increment (1 or -1). |
329 int GetInsertionIndexFrom(const gfx::Rect& dragged_bounds, | 329 int GetInsertionIndexFrom(const gfx::Rect& dragged_bounds, |
330 int start, | 330 int start, |
331 int delta) const; | 331 int delta) const; |
332 | 332 |
333 // Returns the index where the dragged WebContents should be inserted into | 333 // Returns the index where the dragged WebContents should be inserted into |
334 // |attached_tabstrip_| given the DraggedTabView's bounds |dragged_bounds| in | 334 // |attached_tabstrip_| given the DraggedTabView's bounds |dragged_bounds| in |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 // Returns the Widget of the currently attached TabStrip's BrowserView. | 421 // Returns the Widget of the currently attached TabStrip's BrowserView. |
422 views::Widget* GetAttachedBrowserWidget(); | 422 views::Widget* GetAttachedBrowserWidget(); |
423 | 423 |
424 // Returns true if the tabs were originality one after the other in | 424 // Returns true if the tabs were originality one after the other in |
425 // |source_tabstrip_|. | 425 // |source_tabstrip_|. |
426 bool AreTabsConsecutive(); | 426 bool AreTabsConsecutive(); |
427 | 427 |
428 // Creates and returns a new Browser to handle the drag. | 428 // Creates and returns a new Browser to handle the drag. |
429 Browser* CreateBrowserForDrag(TabStrip* source, | 429 Browser* CreateBrowserForDrag(TabStrip* source, |
430 const gfx::Point& point_in_screen, | 430 const gfx::Point& point_in_screen, |
| 431 gfx::Point* drag_offset, |
431 std::vector<gfx::Rect>* drag_bounds); | 432 std::vector<gfx::Rect>* drag_bounds); |
432 | 433 |
433 // Returns the TabStripModel for the specified tabstrip. | 434 // Returns the TabStripModel for the specified tabstrip. |
434 TabStripModel* GetModel(TabStrip* tabstrip) const; | 435 TabStripModel* GetModel(TabStrip* tabstrip) const; |
435 | 436 |
436 // Returns the location of the cursor. This is either the location of the | 437 // Returns the location of the cursor. This is either the location of the |
437 // mouse or the location of the current touch point. | 438 // mouse or the location of the current touch point. |
438 gfx::Point GetCursorScreenPoint(); | 439 gfx::Point GetCursorScreenPoint(); |
439 | 440 |
440 // Returns true if moving the mouse only changes the visible tabs. | 441 // Returns true if moving the mouse only changes the visible tabs. |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 // Non-null for the duration of RunMoveLoop. | 572 // Non-null for the duration of RunMoveLoop. |
572 views::Widget* move_loop_widget_; | 573 views::Widget* move_loop_widget_; |
573 | 574 |
574 // If non-null set to true from destructor. | 575 // If non-null set to true from destructor. |
575 bool* destroyed_; | 576 bool* destroyed_; |
576 | 577 |
577 DISALLOW_COPY_AND_ASSIGN(TabDragController); | 578 DISALLOW_COPY_AND_ASSIGN(TabDragController); |
578 }; | 579 }; |
579 | 580 |
580 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_ | 581 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_ |
OLD | NEW |