Chromium Code Reviews

Side by Side Diff: chrome/browser/cocoa/browser_window_controller.mm

Issue 1727013: Fix dragging a tab out of a window when the only tabs left behind are phantom... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/cocoa/tab_view.mm » ('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) 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/browser_window_controller.h" 5 #import "chrome/browser/cocoa/browser_window_controller.h"
6 6
7 #include <Carbon/Carbon.h> 7 #include <Carbon/Carbon.h>
8 8
9 #include "app/l10n_util_mac.h" 9 #include "app/l10n_util_mac.h"
10 #include "base/mac_util.h" 10 #include "base/mac_util.h"
(...skipping 1254 matching lines...)
1265 CGFloat maxWidth = NSWidth([contentView frame]); 1265 CGFloat maxWidth = NSWidth([contentView frame]);
1266 [findBarCocoaController_ positionFindBarViewAtMaxY:maxY maxWidth:maxWidth]; 1266 [findBarCocoaController_ positionFindBarViewAtMaxY:maxY maxWidth:maxWidth];
1267 } 1267 }
1268 1268
1269 - (NSWindow*)createFullscreenWindow { 1269 - (NSWindow*)createFullscreenWindow {
1270 return [[[FullscreenWindow alloc] initForScreen:[[self window] screen]] 1270 return [[[FullscreenWindow alloc] initForScreen:[[self window] screen]]
1271 autorelease]; 1271 autorelease];
1272 } 1272 }
1273 1273
1274 - (NSInteger)numberOfTabs { 1274 - (NSInteger)numberOfTabs {
1275 // count() includes pinned tabs (both live and phantom).
1275 return browser_->tabstrip_model()->count(); 1276 return browser_->tabstrip_model()->count();
1276 } 1277 }
1277 1278
1279 - (BOOL)hasLiveTabs {
1280 return browser_->tabstrip_model()->HasNonPhantomTabs();
1281 }
1282
1278 - (NSString*)selectedTabTitle { 1283 - (NSString*)selectedTabTitle {
1279 TabContents* contents = browser_->tabstrip_model()->GetSelectedTabContents(); 1284 TabContents* contents = browser_->tabstrip_model()->GetSelectedTabContents();
1280 return base::SysUTF16ToNSString(contents->GetTitle()); 1285 return base::SysUTF16ToNSString(contents->GetTitle());
1281 } 1286 }
1282 1287
1283 - (NSRect)regularWindowFrame { 1288 - (NSRect)regularWindowFrame {
1284 return [self isFullscreen] ? [savedRegularWindow_ frame] : 1289 return [self isFullscreen] ? [savedRegularWindow_ frame] :
1285 [[self window] frame]; 1290 [[self window] frame];
1286 } 1291 }
1287 1292
(...skipping 557 matching lines...)
1845 1850
1846 - (BOOL)supportsBookmarkBar { 1851 - (BOOL)supportsBookmarkBar {
1847 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; 1852 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR];
1848 } 1853 }
1849 1854
1850 - (BOOL)isNormalWindow { 1855 - (BOOL)isNormalWindow {
1851 return browser_->type() == Browser::TYPE_NORMAL; 1856 return browser_->type() == Browser::TYPE_NORMAL;
1852 } 1857 }
1853 1858
1854 @end // @implementation BrowserWindowController(WindowType) 1859 @end // @implementation BrowserWindowController(WindowType)
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/cocoa/tab_view.mm » ('j') | no next file with comments »

Powered by Google App Engine