OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/cocoa/fullscreen_window.h" |
| 6 |
| 7 @implementation FullscreenWindow |
| 8 |
| 9 // Make sure our designated initializer gets called. |
| 10 - (id)init { |
| 11 return [self initForScreen:[NSScreen mainScreen]]; |
| 12 } |
| 13 |
| 14 - (id)initForScreen:(NSScreen*)screen { |
| 15 NSRect contentRect; |
| 16 contentRect.origin = NSZeroPoint; |
| 17 contentRect.size = [screen frame].size; |
| 18 |
| 19 if ((self = [super initWithContentRect:contentRect |
| 20 styleMask:NSBorderlessWindowMask |
| 21 backing:NSBackingStoreBuffered |
| 22 defer:YES |
| 23 screen:screen])) { |
| 24 [self setReleasedWhenClosed:NO]; |
| 25 } |
| 26 return self; |
| 27 } |
| 28 |
| 29 // According to |
| 30 // http://www.cocoabuilder.com/archive/message/cocoa/2006/6/19/165953, |
| 31 // NSBorderlessWindowMask windows cannot become key or main. |
| 32 // In our case, however, we don't want that behavior, so we override |
| 33 // canBecomeKeyWindow and canBecomeMainWindow. |
| 34 |
| 35 - (BOOL)canBecomeKeyWindow { |
| 36 return YES; |
| 37 } |
| 38 |
| 39 - (BOOL)canBecomeMainWindow { |
| 40 return YES; |
| 41 } |
| 42 |
| 43 @end |
OLD | NEW |