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

Unified Diff: chrome/browser/ui/views/tabs/tab_drag_controller.cc

Issue 137993009: Remove more non-aura windows code. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: renable the disabled tests Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/tabs/tab_drag_controller.cc
===================================================================
--- chrome/browser/ui/views/tabs/tab_drag_controller.cc (revision 244775)
+++ chrome/browser/ui/views/tabs/tab_drag_controller.cc (working copy)
@@ -377,7 +377,7 @@
const int TabDragController::kVerticalDetachMagnetism = 15;
TabDragController::TabDragController()
- : detach_into_browser_(ShouldDetachIntoNewBrowser()),
+ : detach_into_browser_(true),
event_source_(EVENT_SOURCE_MOUSE),
source_tabstrip_(NULL),
attached_tabstrip_(NULL),
@@ -500,16 +500,6 @@
return instance_ && instance_->active();
}
-// static
-bool TabDragController::ShouldDetachIntoNewBrowser() {
-#if defined(USE_AURA)
- return true;
-#else
- return CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kTabBrowserDragging);
-#endif
-}
-
void TabDragController::SetMoveBehavior(MoveBehavior behavior) {
if (started_drag())
return;
@@ -1443,8 +1433,6 @@
if (!selection_model.empty())
attached_model->SetSelectionFromModel(selection_model);
}
- } else if (!detach_into_browser_) {
- HideFrame();
}
// Create the dragged view.
@@ -2075,36 +2063,6 @@
return view_screen_bounds;
}
-void TabDragController::HideFrame() {
-#if defined(OS_WIN) && !defined(USE_AURA)
- // We don't actually hide the window, rather we just move it way off-screen.
- // If we actually hide it, we stop receiving drag events.
- //
- // Windows coordinates are 16 bit values. Additionally mouse events are
- // relative, this means if we move this window to the max position it is easy
- // to trigger overflow. To avoid this we don't move to the max position,
- // rather some where reasonably large. This should avoid common overflow
- // problems.
- // An alternative approach is to query the mouse pointer and ignore the
- // location on the mouse (early versions did this). This proves problematic as
- // if we happen to get behind in event processing it is all to easy to process
- // a release in the wrong location, triggering either an unexpected move or an
- // unexpected detach.
- HWND frame_hwnd = source_tabstrip_->GetWidget()->GetNativeView();
- RECT wr;
- GetWindowRect(frame_hwnd, &wr);
- MoveWindow(frame_hwnd, 0x3FFF, 0x3FFF, wr.right - wr.left,
- wr.bottom - wr.top, TRUE);
-
- // We also save the bounds of the window prior to it being moved, so that if
- // the drag session is aborted we can restore them.
- restore_bounds_ = gfx::Rect(wr);
-#else
- // Shouldn't hit as aura triggers the |detach_into_browser_| path.
- NOTREACHED();
-#endif
-}
-
void TabDragController::CleanUpHiddenFrame() {
// If the model we started dragging from is now empty, we must ask the
// delegate to close the frame.

Powered by Google App Engine
This is Rietveld 408576698