summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/tab_view.mm
diff options
context:
space:
mode:
authorpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 20:45:10 +0000
committerpinkerton@chromium.org <pinkerton@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-30 20:45:10 +0000
commit3e2bfcf0ae9e0e81c091294460fdbeaef51f47ad (patch)
treea83837a4e6f7b5dd475703f5876d472c5e8429ec /chrome/browser/cocoa/tab_view.mm
parentad1f9bd8c87effc13dd2c1415862d88a9bab2a17 (diff)
downloadchromium_src-3e2bfcf0ae9e0e81c091294460fdbeaef51f47ad.zip
chromium_src-3e2bfcf0ae9e0e81c091294460fdbeaef51f47ad.tar.gz
chromium_src-3e2bfcf0ae9e0e81c091294460fdbeaef51f47ad.tar.bz2
Fix tab dragging to always hide the new tab button while dragging a tab or targeting an existing window. Makes things much nicer.
BUG=14923, 14925, 15667 TEST=dragging tabs in and out of windows, and within windows. Make sure new tab button goes away when it should and always comes back. Review URL: http://codereview.chromium.org/160345 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22092 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/tab_view.mm')
-rw-r--r--chrome/browser/cocoa/tab_view.mm8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/tab_view.mm b/chrome/browser/cocoa/tab_view.mm
index a8d9fb5..4036b18 100644
--- a/chrome/browser/cocoa/tab_view.mm
+++ b/chrome/browser/cocoa/tab_view.mm
@@ -251,6 +251,8 @@ static const double kDragStartDistance = 3.0;
[dragWindow_ makeMainWindow];
[draggedController_ showOverlay];
dragOverlay_ = [draggedController_ overlayWindow];
+ // Force the new tab button to be hidden. We'll reset it on mouse up.
+ [draggedController_ showNewTabButton:NO];
//if (![targets count])
// [dragOverlay_ setHasShadow:NO];
if (!isTheOnlyTab_) {
@@ -346,6 +348,11 @@ static const double kDragStartDistance = 3.0;
// The drag/click is done. If the user dragged the mouse, finalize the drag
// and clean up.
+ // We are now free to re-display the new tab button in the window we're
+ // dragging. It will show when the next call to -layoutTabs (which happens
+ // indrectly by several of the calls below, such as removing the placeholder).
+ [draggedController_ showNewTabButton:YES];
+
if (draggingWithinTabStrip_) {
if (tabWasDragged_) {
// Move tab to new location.
@@ -370,7 +377,6 @@ static const double kDragStartDistance = 3.0;
[[draggedController_ window] setLevel:NSNormalWindowLevel];
[draggedController_ removePlaceholder];
- [draggedController_ layoutTabs];
}
[sourceController_ removePlaceholder];
chromeIsVisible_ = YES;