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 #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/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
(...skipping 628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
639 } | 639 } |
640 | 640 |
641 - (BOOL)canBecomeKeyWindow { | 641 - (BOOL)canBecomeKeyWindow { |
642 // Panel can only gain focus if it is expanded. Minimized panels do not | 642 // Panel can only gain focus if it is expanded. Minimized panels do not |
643 // participate in Cmd-~ rotation. | 643 // participate in Cmd-~ rotation. |
644 // TODO(dimich): If it will be ever desired to expand/focus the Panel on | 644 // TODO(dimich): If it will be ever desired to expand/focus the Panel on |
645 // keyboard navigation or via main menu, the care should be taken to avoid | 645 // keyboard navigation or via main menu, the care should be taken to avoid |
646 // cases when minimized Panel is getting keyboard input, invisibly. | 646 // cases when minimized Panel is getting keyboard input, invisibly. |
647 return windowShim_->panel()->expansion_state() == Panel::EXPANDED; | 647 return windowShim_->panel()->expansion_state() == Panel::EXPANDED; |
648 } | 648 } |
| 649 |
| 650 - (void)setAlwaysOnTop:(bool)onTop { |
| 651 NSWindow* window = [self window]; |
| 652 [window setLevel:(onTop ? NSStatusWindowLevel : NSNormalWindowLevel)]; |
| 653 } |
649 @end | 654 @end |
OLD | NEW |