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

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

Issue 10824200: Handful of tweaks for tab dragging with touch: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab_drag_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 // What should happen as the mouse is dragged within the tabstrip. 61 // What should happen as the mouse is dragged within the tabstrip.
62 enum MoveBehavior { 62 enum MoveBehavior {
63 // Only the set of visible tabs should change. This is only applicable when 63 // Only the set of visible tabs should change. This is only applicable when
64 // using touch layout. 64 // using touch layout.
65 MOVE_VISIBILE_TABS, 65 MOVE_VISIBILE_TABS,
66 66
67 // Typical behavior where tabs are dragged around. 67 // Typical behavior where tabs are dragged around.
68 REORDER 68 REORDER
69 }; 69 };
70 70
71 // Amount above or below the tabstrip the user has to drag before detaching.
72 static const int kTouchVerticalDetachMagnetism;
73 static const int kVerticalDetachMagnetism;
74
71 TabDragController(); 75 TabDragController();
72 virtual ~TabDragController(); 76 virtual ~TabDragController();
73 77
74 // Initializes TabDragController to drag the tabs in |tabs| originating 78 // Initializes TabDragController to drag the tabs in |tabs| originating
75 // from |source_tabstrip|. |source_tab| is the tab that initiated the drag and 79 // from |source_tabstrip|. |source_tab| is the tab that initiated the drag and
76 // is contained in |tabs|. |mouse_offset| is the distance of the mouse 80 // is contained in |tabs|. |mouse_offset| is the distance of the mouse
77 // pointer from the origin of the first tab in |tabs| and |source_tab_offset| 81 // pointer from the origin of the first tab in |tabs| and |source_tab_offset|
78 // the offset from |source_tab|. |source_tab_offset| is the horizontal distant 82 // the offset from |source_tab|. |source_tab_offset| is the horizontal distant
79 // for a horizontal tab strip, and the vertical distance for a vertical tab 83 // for a horizontal tab strip, and the vertical distance for a vertical tab
80 // strip. |initial_selection_model| is the selection model before the drag 84 // strip. |initial_selection_model| is the selection model before the drag
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 // If necessary starts the |move_stacked_timer_|. The timer is started if 288 // If necessary starts the |move_stacked_timer_|. The timer is started if
285 // close enough to an edge with stacked tabs. 289 // close enough to an edge with stacked tabs.
286 void StartMoveStackedTimerIfNecessary( 290 void StartMoveStackedTimerIfNecessary(
287 const gfx::Point& point_in_screen, 291 const gfx::Point& point_in_screen,
288 int delay_ms); 292 int delay_ms);
289 293
290 // Returns the TabStrip for the specified window, or NULL if one doesn't exist 294 // Returns the TabStrip for the specified window, or NULL if one doesn't exist
291 // or isn't compatible. 295 // or isn't compatible.
292 TabStrip* GetTabStripForWindow(gfx::NativeWindow window); 296 TabStrip* GetTabStripForWindow(gfx::NativeWindow window);
293 297
294 // Returns the compatible TabStrip that is under the specified point (screen 298 // Returns the compatible TabStrip to drag to at the specified point (screen
295 // coordinates), or NULL if there is none. 299 // coordinates), or NULL if there is none.
296 TabStrip* GetTabStripForPoint(const gfx::Point& point_in_screen); 300 TabStrip* GetTargetTabStripForPoint(const gfx::Point& point_in_screen);
297 301
298 // Returns true if |tabstrip| contains the specified point in screen 302 // Returns true if |tabstrip| contains the specified point in screen
299 // coordinates. 303 // coordinates.
300 bool DoesTabStripContain(TabStrip* tabstrip, 304 bool DoesTabStripContain(TabStrip* tabstrip,
301 const gfx::Point& point_in_screen) const; 305 const gfx::Point& point_in_screen) const;
302 306
303 // Returns the DetachPosition given the specified location in screen 307 // Returns the DetachPosition given the specified location in screen
304 // coordinates. 308 // coordinates.
305 DetachPosition GetDetachPosition(const gfx::Point& point_in_screen); 309 DetachPosition GetDetachPosition(const gfx::Point& point_in_screen);
306 310
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
567 // Non-null for the duration of RunMoveLoop. 571 // Non-null for the duration of RunMoveLoop.
568 views::Widget* move_loop_widget_; 572 views::Widget* move_loop_widget_;
569 573
570 // If non-null set to true from destructor. 574 // If non-null set to true from destructor.
571 bool* destroyed_; 575 bool* destroyed_;
572 576
573 DISALLOW_COPY_AND_ASSIGN(TabDragController); 577 DISALLOW_COPY_AND_ASSIGN(TabDragController);
574 }; 578 };
575 579
576 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_ 580 #endif // CHROME_BROWSER_UI_VIEWS_TABS_TAB_DRAG_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab_drag_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698