| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h" | 5 #include "chrome/browser/gtk/tabs/dragged_tab_controller_gtk.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "chrome/browser/browser.h" | |
| 11 #include "chrome/browser/gtk/browser_window_gtk.h" | 10 #include "chrome/browser/gtk/browser_window_gtk.h" |
| 12 #include "chrome/browser/gtk/gtk_util.h" | 11 #include "chrome/browser/gtk/gtk_util.h" |
| 13 #include "chrome/browser/gtk/tabs/dragged_tab_gtk.h" | 12 #include "chrome/browser/gtk/tabs/dragged_tab_gtk.h" |
| 14 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" | 13 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" |
| 15 #include "chrome/browser/platform_util.h" | 14 #include "chrome/browser/platform_util.h" |
| 16 #include "chrome/browser/tab_contents/tab_contents.h" | 15 #include "chrome/browser/tab_contents/tab_contents.h" |
| 17 #include "chrome/browser/tabs/tab_strip_model.h" | 16 #include "chrome/browser/tabs/tab_strip_model.h" |
| 17 #include "chrome/browser/ui/browser.h" |
| 18 #include "chrome/common/notification_service.h" | 18 #include "chrome/common/notification_service.h" |
| 19 | 19 |
| 20 namespace { | 20 namespace { |
| 21 | 21 |
| 22 // Delay, in ms, during dragging before we bring a window to front. | 22 // Delay, in ms, during dragging before we bring a window to front. |
| 23 const int kBringToFrontDelay = 750; | 23 const int kBringToFrontDelay = 750; |
| 24 | 24 |
| 25 // Used to determine how far a tab must obscure another tab in order to swap | 25 // Used to determine how far a tab must obscure another tab in order to swap |
| 26 // their indexes. | 26 // their indexes. |
| 27 const int kHorizontalMoveThreshold = 16; // pixels | 27 const int kHorizontalMoveThreshold = 16; // pixels |
| (...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 776 gfx::NativeView dragged_tab = dragged_tab_->widget(); | 776 gfx::NativeView dragged_tab = dragged_tab_->widget(); |
| 777 dock_windows_.insert(dragged_tab); | 777 dock_windows_.insert(dragged_tab); |
| 778 window = DockInfo::GetLocalProcessWindowAtPoint(GetCursorScreenPoint(), | 778 window = DockInfo::GetLocalProcessWindowAtPoint(GetCursorScreenPoint(), |
| 779 dock_windows_); | 779 dock_windows_); |
| 780 dock_windows_.erase(dragged_tab); | 780 dock_windows_.erase(dragged_tab); |
| 781 } | 781 } |
| 782 | 782 |
| 783 if (window) | 783 if (window) |
| 784 gtk_window_present(GTK_WINDOW(window)); | 784 gtk_window_present(GTK_WINDOW(window)); |
| 785 } | 785 } |
| OLD | NEW |