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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 int source_tab_offset, | 102 int source_tab_offset, |
103 const ui::ListSelectionModel& initial_selection_model, | 103 const ui::ListSelectionModel& initial_selection_model, |
104 DetachBehavior detach_behavior, | 104 DetachBehavior detach_behavior, |
105 MoveBehavior move_behavior, | 105 MoveBehavior move_behavior, |
106 EventSource event_source); | 106 EventSource event_source); |
107 | 107 |
108 // Returns true if there is a drag underway and the drag is attached to | 108 // Returns true if there is a drag underway and the drag is attached to |
109 // |tab_strip|. | 109 // |tab_strip|. |
110 // NOTE: this returns false if the TabDragController is in the process of | 110 // NOTE: this returns false if the TabDragController is in the process of |
111 // finishing the drag. | 111 // finishing the drag. |
112 static bool IsAttachedTo(TabStrip* tab_strip); | 112 static bool IsAttachedTo(const TabStrip* tab_strip); |
113 | 113 |
114 // Returns true if there is a drag underway. | 114 // Returns true if there is a drag underway. |
115 static bool IsActive(); | 115 static bool IsActive(); |
116 | 116 |
117 // Used to determine whether the tab drag controller detaches dragged tabs | 117 // Used to determine whether the tab drag controller detaches dragged tabs |
118 // into new browser windows while the drag is in process. | 118 // into new browser windows while the drag is in process. |
119 static bool ShouldDetachIntoNewBrowser(); | 119 static bool ShouldDetachIntoNewBrowser(); |
120 | 120 |
121 // Sets the move behavior. Has no effect if started_drag() is true. | 121 // Sets the move behavior. Has no effect if started_drag() is true. |
122 void SetMoveBehavior(MoveBehavior behavior); | 122 void SetMoveBehavior(MoveBehavior behavior); |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 TabStripModel* GetModel(TabStrip* tabstrip) const; | 467 TabStripModel* GetModel(TabStrip* tabstrip) const; |
468 | 468 |
469 // Returns the location of the cursor. This is either the location of the | 469 // Returns the location of the cursor. This is either the location of the |
470 // mouse or the location of the current touch point. | 470 // mouse or the location of the current touch point. |
471 gfx::Point GetCursorScreenPoint(); | 471 gfx::Point GetCursorScreenPoint(); |
472 | 472 |
473 // Returns the offset from the top left corner of the window to | 473 // Returns the offset from the top left corner of the window to |
474 // |point_in_screen|. | 474 // |point_in_screen|. |
475 gfx::Vector2d GetWindowOffset(const gfx::Point& point_in_screen); | 475 gfx::Vector2d GetWindowOffset(const gfx::Point& point_in_screen); |
476 | 476 |
| 477 // Returns true if |tab_strip| browser window is docked. |
| 478 static bool IsDocked(const TabStrip* tab_strip); |
| 479 |
477 // Returns true if moving the mouse only changes the visible tabs. | 480 // Returns true if moving the mouse only changes the visible tabs. |
478 bool move_only() const { | 481 bool move_only() const { |
479 return (move_behavior_ == MOVE_VISIBILE_TABS) != 0; | 482 return (move_behavior_ == MOVE_VISIBILE_TABS) != 0; |
480 } | 483 } |
481 | 484 |
482 // If true detaching creates a new browser and enters a nested message loop. | 485 // If true detaching creates a new browser and enters a nested message loop. |
483 bool detach_into_browser_; | 486 bool detach_into_browser_; |
484 | 487 |
485 // Handles registering for notifications. | 488 // Handles registering for notifications. |
486 content::NotificationRegistrar registrar_; | 489 content::NotificationRegistrar registrar_; |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 // See comment around use for more details. | 639 // See comment around use for more details. |
637 int attach_x_; | 640 int attach_x_; |
638 int attach_index_; | 641 int attach_index_; |
639 | 642 |
640 base::WeakPtrFactory<TabDragController> weak_factory_; | 643 base::WeakPtrFactory<TabDragController> weak_factory_; |
641 | 644 |
642 DISALLOW_COPY_AND_ASSIGN(TabDragController); | 645 DISALLOW_COPY_AND_ASSIGN(TabDragController); |
643 }; | 646 }; |
644 | 647 |
645 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_ | 648 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_ |
OLD | NEW |