| 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 #import "chrome/browser/cocoa/tab_view.h" | 5 #import "chrome/browser/cocoa/tab_view.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/nsimage_cache_mac.h" | 8 #include "base/nsimage_cache_mac.h" |
| 9 #include "chrome/browser/browser_theme_provider.h" | 9 #include "chrome/browser/browser_theme_provider.h" |
| 10 #import "chrome/browser/cocoa/tab_controller.h" | 10 #import "chrome/browser/cocoa/tab_controller.h" |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 [sourceController_ removePlaceholder]; | 405 [sourceController_ removePlaceholder]; |
| 406 | 406 |
| 407 // Detach from the current window and put it in a new window. If there are | 407 // Detach from the current window and put it in a new window. If there are |
| 408 // no more tabs remaining after detaching, the source window is about to | 408 // no more tabs remaining after detaching, the source window is about to |
| 409 // go away (it's been autoreleased) so we need to ensure we don't reference | 409 // go away (it's been autoreleased) so we need to ensure we don't reference |
| 410 // it any more. In that case the new controller becomes our source | 410 // it any more. In that case the new controller becomes our source |
| 411 // controller. | 411 // controller. |
| 412 draggedController_ = [sourceController_ detachTabToNewWindow:self]; | 412 draggedController_ = [sourceController_ detachTabToNewWindow:self]; |
| 413 dragWindow_ = [draggedController_ window]; | 413 dragWindow_ = [draggedController_ window]; |
| 414 [dragWindow_ setAlphaValue:0.0]; | 414 [dragWindow_ setAlphaValue:0.0]; |
| 415 if (![sourceController_ numberOfTabs]) { | 415 if (![sourceController_ hasLiveTabs]) { |
| 416 sourceController_ = draggedController_; | 416 sourceController_ = draggedController_; |
| 417 sourceWindow_ = dragWindow_; | 417 sourceWindow_ = dragWindow_; |
| 418 } | 418 } |
| 419 | 419 |
| 420 // If dragging the tab only moves the current window, do not show overlay | 420 // If dragging the tab only moves the current window, do not show overlay |
| 421 // so that sheets stay on top of the window. | 421 // so that sheets stay on top of the window. |
| 422 // Bring the target window to the front and make sure it has a border. | 422 // Bring the target window to the front and make sure it has a border. |
| 423 [dragWindow_ setLevel:NSFloatingWindowLevel]; | 423 [dragWindow_ setLevel:NSFloatingWindowLevel]; |
| 424 [dragWindow_ setHasShadow:YES]; | 424 [dragWindow_ setHasShadow:YES]; |
| 425 [dragWindow_ orderFront:nil]; | 425 [dragWindow_ orderFront:nil]; |
| (...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 959 } | 959 } |
| 960 | 960 |
| 961 if (nextUpdate < kNoUpdate) | 961 if (nextUpdate < kNoUpdate) |
| 962 [self performSelector:_cmd withObject:nil afterDelay:nextUpdate]; | 962 [self performSelector:_cmd withObject:nil afterDelay:nextUpdate]; |
| 963 | 963 |
| 964 [self resetLastGlowUpdateTime]; | 964 [self resetLastGlowUpdateTime]; |
| 965 [self setNeedsDisplay:YES]; | 965 [self setNeedsDisplay:YES]; |
| 966 } | 966 } |
| 967 | 967 |
| 968 @end // @implementation TabView(Private) | 968 @end // @implementation TabView(Private) |
| OLD | NEW |