Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: chrome/browser/ui/panels/panel_window_controller_cocoa.mm

Issue 8686012: Make panels not show on top when there is an app running in full screen mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 if (isFullScreenModeOn) {
Dmitry Titov 2011/11/30 01:35:53 '{' is not needed (and not balanced here). Since o
prasadt 2011/11/30 02:38:47 Done. And oops :-) I haven't yet compiled on mac.
573 [window setLevel:NSStatusWindowLevel];
574 else {
575 [window setLevel:NSNormalWindowLevel];
576 }
577
569 - (BOOL)canBecomeKeyWindow { 578 - (BOOL)canBecomeKeyWindow {
570 // Panel can only gain focus if it is expanded. Minimized panels do not 579 // Panel can only gain focus if it is expanded. Minimized panels do not
571 // participate in Cmd-~ rotation. 580 // participate in Cmd-~ rotation.
572 // TODO(dimich): If it will be ever desired to expand/focus the Panel on 581 // 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 582 // keyboard navigation or via main menu, the care should be taken to avoid
574 // cases when minimized Panel is getting keyboard input, invisibly. 583 // cases when minimized Panel is getting keyboard input, invisibly.
575 return windowShim_->panel()->expansion_state() == Panel::EXPANDED; 584 return windowShim_->panel()->expansion_state() == Panel::EXPANDED;
576 } 585 }
577 586
578 @end 587 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698