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

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

Issue 1747803003: MacViews: Implement Tab Dragging (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't set the window position inside the RunMoveLoop call. Created 4 years, 6 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
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.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 #include "chrome/browser/ui/views/tabs/tab_drag_controller.h" 5 #include "chrome/browser/ui/views/tabs/tab_drag_controller.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 #include <set> 8 #include <set>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
383 point_in_screen.x() - 383 point_in_screen.x() -
384 mouse_offset_.x(), 0); 384 mouse_offset_.x(), 0);
385 widget->SetVisibilityChangedAnimationsEnabled(false); 385 widget->SetVisibilityChangedAnimationsEnabled(false);
386 widget->Restore(); 386 widget->Restore();
387 widget->SetBounds(new_bounds); 387 widget->SetBounds(new_bounds);
388 AdjustBrowserAndTabBoundsForDrag(last_tabstrip_width, 388 AdjustBrowserAndTabBoundsForDrag(last_tabstrip_width,
389 point_in_screen, 389 point_in_screen,
390 &drag_bounds); 390 &drag_bounds);
391 widget->SetVisibilityChangedAnimationsEnabled(true); 391 widget->SetVisibilityChangedAnimationsEnabled(true);
392 } 392 }
393
394 views::Widget* widget = GetAttachedBrowserWidget();
sky 2016/06/16 15:56:12 As this part is really a separate bug, could you c
themblsha 2016/06/17 14:58:07 There's already a bug for this: https://bugs.chrom
395 gfx::Rect bounds = widget->GetWindowBoundsInScreen();
396 bounds.Offset(point_in_screen.x() - start_point_in_screen_.x(),
397 point_in_screen.y() - start_point_in_screen_.y());
398 widget->SetBounds(bounds);
393 RunMoveLoop(GetWindowOffset(point_in_screen)); 399 RunMoveLoop(GetWindowOffset(point_in_screen));
394 return; 400 return;
395 } 401 }
396 } 402 }
397 403
398 if (ContinueDragging(point_in_screen) == Liveness::DELETED) 404 if (ContinueDragging(point_in_screen) == Liveness::DELETED)
399 return; 405 return;
400 } 406 }
401 407
402 void TabDragController::EndDrag(EndDragReason reason) { 408 void TabDragController::EndDrag(EndDragReason reason) {
(...skipping 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after
1807 // TODO(pkotwicz): Fix this properly (crbug.com/358482) 1813 // TODO(pkotwicz): Fix this properly (crbug.com/358482)
1808 for (auto* browser : *BrowserList::GetInstance()) { 1814 for (auto* browser : *BrowserList::GetInstance()) {
1809 if (browser->tab_strip_model()->empty()) 1815 if (browser->tab_strip_model()->empty())
1810 exclude.insert(browser->window()->GetNativeWindow()); 1816 exclude.insert(browser->window()->GetNativeWindow());
1811 } 1817 }
1812 #endif 1818 #endif
1813 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr()); 1819 base::WeakPtr<TabDragController> ref(weak_factory_.GetWeakPtr());
1814 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude); 1820 *window = window_finder_->GetLocalProcessWindowAtPoint(screen_point, exclude);
1815 return ref ? Liveness::ALIVE : Liveness::DELETED; 1821 return ref ? Liveness::ALIVE : Liveness::DELETED;
1816 } 1822 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab_drag_controller_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698