| 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/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...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) |
| OLD | NEW |