| 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_GTK_TABS_DRAGGED_TAB_CONTROLLER_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_TABS_DRAGGED_TAB_CONTROLLER_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_TABS_DRAGGED_TAB_CONTROLLER_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_TABS_DRAGGED_TAB_CONTROLLER_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
| 17 #include "chrome/browser/ui/gtk/tabs/drag_data.h" | 17 #include "chrome/browser/ui/gtk/tabs/drag_data.h" |
| 18 #include "chrome/browser/ui/tabs/dock_info.h" | |
| 19 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
| 20 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
| 21 #include "content/public/browser/web_contents_delegate.h" | 20 #include "content/public/browser/web_contents_delegate.h" |
| 22 #include "ui/base/x/x11_util.h" | 21 #include "ui/base/x/x11_util.h" |
| 23 | 22 |
| 24 class DraggedViewGtk; | 23 class DraggedViewGtk; |
| 25 class TabGtk; | 24 class TabGtk; |
| 26 class TabStripGtk; | 25 class TabStripGtk; |
| 27 class TabStripModel; | 26 class TabStripModel; |
| 28 | 27 |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 // position. | 209 // position. |
| 211 void OnAnimateToBoundsComplete(); | 210 void OnAnimateToBoundsComplete(); |
| 212 | 211 |
| 213 // Activates whichever window is under the mouse. | 212 // Activates whichever window is under the mouse. |
| 214 void BringWindowUnderMouseToFront(); | 213 void BringWindowUnderMouseToFront(); |
| 215 | 214 |
| 216 // Returns true if the tabs were originally one after the other in | 215 // Returns true if the tabs were originally one after the other in |
| 217 // |source_tabstrip_|. | 216 // |source_tabstrip_|. |
| 218 bool AreTabsConsecutive(); | 217 bool AreTabsConsecutive(); |
| 219 | 218 |
| 219 // Returns the NativeWindow at the specified point, not including the window |
| 220 // being dragged. |
| 221 gfx::NativeWindow GetLocalProcessWindow(const gfx::Point& screen_point); |
| 222 |
| 220 // Handles registering for notifications. | 223 // Handles registering for notifications. |
| 221 content::NotificationRegistrar registrar_; | 224 content::NotificationRegistrar registrar_; |
| 222 | 225 |
| 223 // The tab strip |source_tab_| originated from. | 226 // The tab strip |source_tab_| originated from. |
| 224 TabStripGtk* source_tabstrip_; | 227 TabStripGtk* source_tabstrip_; |
| 225 | 228 |
| 226 // Holds various data for each dragged tab needed to handle dragging. | 229 // Holds various data for each dragged tab needed to handle dragging. |
| 227 scoped_ptr<DragData> drag_data_; | 230 scoped_ptr<DragData> drag_data_; |
| 228 | 231 |
| 229 // The TabStrip the dragged Tab is currently attached to, or NULL if the | 232 // The TabStrip the dragged Tab is currently attached to, or NULL if the |
| (...skipping 18 matching lines...) Expand all Loading... |
| 248 // drag controller more than once. | 251 // drag controller more than once. |
| 249 bool in_destructor_; | 252 bool in_destructor_; |
| 250 | 253 |
| 251 // The horizontal position of the mouse cursor in screen coordinates at the | 254 // The horizontal position of the mouse cursor in screen coordinates at the |
| 252 // time of the last re-order event. | 255 // time of the last re-order event. |
| 253 int last_move_screen_x_; | 256 int last_move_screen_x_; |
| 254 | 257 |
| 255 // True until |MoveAttached| is invoked once. | 258 // True until |MoveAttached| is invoked once. |
| 256 bool initial_move_; | 259 bool initial_move_; |
| 257 | 260 |
| 258 // DockInfo for the tabstrip. | |
| 259 DockInfo dock_info_; | |
| 260 | |
| 261 typedef std::set<GtkWidget*> DockWindows; | |
| 262 DockWindows dock_windows_; | |
| 263 | |
| 264 // Timer used to bring the window under the cursor to front. If the user | 261 // Timer used to bring the window under the cursor to front. If the user |
| 265 // stops moving the mouse for a brief time over a browser window, it is | 262 // stops moving the mouse for a brief time over a browser window, it is |
| 266 // brought to front. | 263 // brought to front. |
| 267 base::OneShotTimer<DraggedTabControllerGtk> bring_to_front_timer_; | 264 base::OneShotTimer<DraggedTabControllerGtk> bring_to_front_timer_; |
| 268 | 265 |
| 269 DISALLOW_COPY_AND_ASSIGN(DraggedTabControllerGtk); | 266 DISALLOW_COPY_AND_ASSIGN(DraggedTabControllerGtk); |
| 270 }; | 267 }; |
| 271 | 268 |
| 272 #endif // CHROME_BROWSER_UI_GTK_TABS_DRAGGED_TAB_CONTROLLER_GTK_H_ | 269 #endif // CHROME_BROWSER_UI_GTK_TABS_DRAGGED_TAB_CONTROLLER_GTK_H_ |
| OLD | NEW |