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 #include "chrome/browser/ui/panels/panel_window_controller_cocoa.h" | 5 #include "chrome/browser/ui/panels/panel_window_controller_cocoa.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 return [BrowserWindowUtils themePatternPhaseFor:windowView withTabStrip:nil]; | 105 return [BrowserWindowUtils themePatternPhaseFor:windowView withTabStrip:nil]; |
106 } | 106 } |
107 | 107 |
108 - (void)awakeFromNib { | 108 - (void)awakeFromNib { |
109 NSWindow* window = [self window]; | 109 NSWindow* window = [self window]; |
110 | 110 |
111 DCHECK(window); | 111 DCHECK(window); |
112 DCHECK(titlebar_view_); | 112 DCHECK(titlebar_view_); |
113 DCHECK_EQ(self, [window delegate]); | 113 DCHECK_EQ(self, [window delegate]); |
114 | 114 |
115 [window setLevel:NSStatusWindowLevel]; | 115 if (!windowShim_->panel()->manager()->is_full_screen_mode_on()) |
| 116 [window setLevel:NSStatusWindowLevel]; |
116 | 117 |
117 if (base::mac::IsOSSnowLeopardOrLater()) { | 118 if (base::mac::IsOSSnowLeopardOrLater()) { |
118 [window setCollectionBehavior: | 119 [window setCollectionBehavior: |
119 NSWindowCollectionBehaviorParticipatesInCycle]; | 120 NSWindowCollectionBehaviorParticipatesInCycle]; |
120 } | 121 } |
121 | 122 |
122 [titlebar_view_ attach]; | 123 [titlebar_view_ attach]; |
123 | 124 |
124 // Set initial size of the window to match the size of the panel to give | 125 // Set initial size of the window to match the size of the panel to give |
125 // the renderer the proper size to work with earlier, avoiding a resize | 126 // the renderer the proper size to work with earlier, avoiding a resize |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 BrowserWindow* browser_window = | 560 BrowserWindow* browser_window = |
560 windowShim_->panel()->manager()->GetNextBrowserWindowToActivate( | 561 windowShim_->panel()->manager()->GetNextBrowserWindowToActivate( |
561 windowShim_->panel()); | 562 windowShim_->panel()); |
562 | 563 |
563 if (browser_window) | 564 if (browser_window) |
564 browser_window->Activate(); | 565 browser_window->Activate(); |
565 else | 566 else |
566 [NSApp deactivate]; | 567 [NSApp deactivate]; |
567 } | 568 } |
568 | 569 |
| 570 - (void)fullScreenModeChanged:(bool)isFullScreenModeOn { |
| 571 NSWindow* window = [self window]; |
| 572 [window setLevel:(isFullScreenModeOn ? |
| 573 NSNormalWindowLevel : NSStatusWindowLevel)]; |
| 574 } |
| 575 |
569 - (BOOL)canBecomeKeyWindow { | 576 - (BOOL)canBecomeKeyWindow { |
570 // Panel can only gain focus if it is expanded. Minimized panels do not | 577 // Panel can only gain focus if it is expanded. Minimized panels do not |
571 // participate in Cmd-~ rotation. | 578 // participate in Cmd-~ rotation. |
572 // TODO(dimich): If it will be ever desired to expand/focus the Panel on | 579 // TODO(dimich): If it will be ever desired to expand/focus the Panel on |
573 // keyboard navigation or via main menu, the care should be taken to avoid | 580 // keyboard navigation or via main menu, the care should be taken to avoid |
574 // cases when minimized Panel is getting keyboard input, invisibly. | 581 // cases when minimized Panel is getting keyboard input, invisibly. |
575 return windowShim_->panel()->expansion_state() == Panel::EXPANDED; | 582 return windowShim_->panel()->expansion_state() == Panel::EXPANDED; |
576 } | 583 } |
577 | 584 |
578 @end | 585 @end |
OLD | NEW |