OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/presentation_mode_controller.h" | 5 #import "chrome/browser/ui/cocoa/presentation_mode_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #import "base/mac/mac_util.h" | 10 #import "base/mac/mac_util.h" |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
253 enteringPresentationMode_ = YES; | 253 enteringPresentationMode_ = YES; |
254 inPresentationMode_ = YES; | 254 inPresentationMode_ = YES; |
255 contentView_ = contentView; | 255 contentView_ = contentView; |
256 [self changeToolbarFraction:(showDropdown ? 1 : 0)]; | 256 [self changeToolbarFraction:(showDropdown ? 1 : 0)]; |
257 [self updateMenuBarAndDockVisibility]; | 257 [self updateMenuBarAndDockVisibility]; |
258 | 258 |
259 // Register for notifications. Self is removed as an observer in |-cleanup|. | 259 // Register for notifications. Self is removed as an observer in |-cleanup|. |
260 NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; | 260 NSNotificationCenter* nc = [NSNotificationCenter defaultCenter]; |
261 NSWindow* window = [browserController_ window]; | 261 NSWindow* window = [browserController_ window]; |
262 | 262 |
263 // Disable these notifications on Lion as they cause crashes. | |
264 // TODO(rohitrao): Figure out what happens if a fullscreen window changes | |
265 // monitors on Lion. | |
266 if (base::mac::IsOSSnowLeopard()) { | |
267 [nc addObserver:self | |
268 selector:@selector(windowDidChangeScreen:) | |
269 name:NSWindowDidChangeScreenNotification | |
270 object:window]; | |
271 | |
272 [nc addObserver:self | |
273 selector:@selector(windowDidMove:) | |
274 name:NSWindowDidMoveNotification | |
275 object:window]; | |
276 } | |
277 | |
278 [nc addObserver:self | 263 [nc addObserver:self |
279 selector:@selector(windowDidBecomeMain:) | 264 selector:@selector(windowDidBecomeMain:) |
280 name:NSWindowDidBecomeMainNotification | 265 name:NSWindowDidBecomeMainNotification |
281 object:window]; | 266 object:window]; |
282 | 267 |
283 [nc addObserver:self | 268 [nc addObserver:self |
284 selector:@selector(windowDidResignMain:) | 269 selector:@selector(windowDidResignMain:) |
285 name:NSWindowDidResignMainNotification | 270 name:NSWindowDidResignMainNotification |
286 object:window]; | 271 object:window]; |
287 | 272 |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
773 [self updateMenuBarAndDockVisibility]; | 758 [self updateMenuBarAndDockVisibility]; |
774 | 759 |
775 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 | 760 // TODO(rohitrao): Remove the Exit Fullscreen button. http://crbug.com/35956 |
776 } | 761 } |
777 | 762 |
778 - (BOOL)shouldShowMenubarInImmersiveFullscreen { | 763 - (BOOL)shouldShowMenubarInImmersiveFullscreen { |
779 return [self doesScreenHaveMenuBar] && toolbarFraction_ > 0.99; | 764 return [self doesScreenHaveMenuBar] && toolbarFraction_ > 0.99; |
780 } | 765 } |
781 | 766 |
782 @end | 767 @end |
OLD | NEW |