OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/cocoa/browser_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
6 | 6 |
7 #include <Carbon/Carbon.h> | 7 #include <Carbon/Carbon.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 #include <numeric> | 10 #include <numeric> |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 // architecture) and thus BrowserWindowController never gets released. This | 267 // architecture) and thus BrowserWindowController never gets released. This |
268 // prevents the browser from being able to quit <http://crbug.com/79113>. | 268 // prevents the browser from being able to quit <http://crbug.com/79113>. |
269 if ([window respondsToSelector:@selector(setRestorable:)]) | 269 if ([window respondsToSelector:@selector(setRestorable:)]) |
270 [window setRestorable:NO]; | 270 [window setRestorable:NO]; |
271 | 271 |
272 // Get the windows to swish in on Lion. | 272 // Get the windows to swish in on Lion. |
273 if ([window respondsToSelector:@selector(setAnimationBehavior:)]) | 273 if ([window respondsToSelector:@selector(setAnimationBehavior:)]) |
274 [window setAnimationBehavior:NSWindowAnimationBehaviorDocumentWindow]; | 274 [window setAnimationBehavior:NSWindowAnimationBehaviorDocumentWindow]; |
275 | 275 |
276 // Set the window to participate in Lion Fullscreen mode. Setting this flag | 276 // Set the window to participate in Lion Fullscreen mode. Setting this flag |
277 // has no effect on Snow Leopard or earlier. | 277 // has no effect on Snow Leopard or earlier. Popups and the devtools panel |
| 278 // can share a fullscreen space with a tabbed window, but they can not be |
| 279 // primary fullscreen windows. |
278 NSUInteger collectionBehavior = [window collectionBehavior]; | 280 NSUInteger collectionBehavior = [window collectionBehavior]; |
279 collectionBehavior |= NSWindowCollectionBehaviorFullScreenPrimary; | 281 collectionBehavior |= browser_->type() == Browser::TYPE_TABBED ? |
| 282 NSWindowCollectionBehaviorFullScreenPrimary : |
| 283 NSWindowCollectionBehaviorFullScreenAuxiliary; |
280 [window setCollectionBehavior:collectionBehavior]; | 284 [window setCollectionBehavior:collectionBehavior]; |
281 | 285 |
282 // Get the most appropriate size for the window, then enforce the | 286 // Get the most appropriate size for the window, then enforce the |
283 // minimum width and height. The window shim will handle flipping | 287 // minimum width and height. The window shim will handle flipping |
284 // the coordinates for us so we can use it to save some code. | 288 // the coordinates for us so we can use it to save some code. |
285 // Note that this may leave a significant portion of the window | 289 // Note that this may leave a significant portion of the window |
286 // offscreen, but there will always be enough window onscreen to | 290 // offscreen, but there will always be enough window onscreen to |
287 // drag the whole window back into view. | 291 // drag the whole window back into view. |
288 gfx::Rect desiredContentRect = browser_->GetSavedWindowBounds(); | 292 gfx::Rect desiredContentRect = browser_->GetSavedWindowBounds(); |
289 gfx::Rect windowRect = desiredContentRect; | 293 gfx::Rect windowRect = desiredContentRect; |
(...skipping 1999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2289 | 2293 |
2290 - (BOOL)supportsBookmarkBar { | 2294 - (BOOL)supportsBookmarkBar { |
2291 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2295 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2292 } | 2296 } |
2293 | 2297 |
2294 - (BOOL)isTabbedWindow { | 2298 - (BOOL)isTabbedWindow { |
2295 return browser_->is_type_tabbed(); | 2299 return browser_->is_type_tabbed(); |
2296 } | 2300 } |
2297 | 2301 |
2298 @end // @implementation BrowserWindowController(WindowType) | 2302 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |