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

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

Issue 9593001: Revert 124790 - Minimized panels should not open on Windows when activated by the OS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 9 months 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
« no previous file with comments | « chrome/browser/ui/panels/panel_window_controller_cocoa.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 73
74 @implementation PanelWindowControllerCocoa 74 @implementation PanelWindowControllerCocoa
75 75
76 - (id)initWithBrowserWindow:(PanelBrowserWindowCocoa*)window { 76 - (id)initWithBrowserWindow:(PanelBrowserWindowCocoa*)window {
77 NSString* nibpath = 77 NSString* nibpath =
78 [base::mac::FrameworkBundle() pathForResource:@"Panel" ofType:@"nib"]; 78 [base::mac::FrameworkBundle() pathForResource:@"Panel" ofType:@"nib"];
79 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { 79 if ((self = [super initWithWindowNibPath:nibpath owner:self])) {
80 windowShim_.reset(window); 80 windowShim_.reset(window);
81 animateOnBoundsChange_ = YES; 81 animateOnBoundsChange_ = YES;
82 canBecomeKeyWindow_ = YES;
83 } 82 }
84 contentsController_.reset( 83 contentsController_.reset(
85 [[TabContentsController alloc] initWithContents:nil]); 84 [[TabContentsController alloc] initWithContents:nil]);
86 return self; 85 return self;
87 } 86 }
88 87
89 - (void)dealloc { 88 - (void)dealloc {
90 if (windowTrackingArea_.get()) { 89 if (windowTrackingArea_.get()) {
91 [[[[self window] contentView] superview] 90 [[[[self window] contentView] superview]
92 removeTrackingArea:windowTrackingArea_.get()]; 91 removeTrackingArea:windowTrackingArea_.get()];
(...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 BrowserWindow* browser_window = 616 BrowserWindow* browser_window =
618 windowShim_->panel()->manager()->GetNextBrowserWindowToActivate( 617 windowShim_->panel()->manager()->GetNextBrowserWindowToActivate(
619 windowShim_->panel()); 618 windowShim_->panel());
620 619
621 if (browser_window) 620 if (browser_window)
622 browser_window->Activate(); 621 browser_window->Activate();
623 else 622 else
624 [NSApp deactivate]; 623 [NSApp deactivate];
625 } 624 }
626 625
627 - (void)preventBecomingKeyWindow:(BOOL)prevent {
628 canBecomeKeyWindow_ = !prevent;
629 }
630
631 - (void)fullScreenModeChanged:(bool)isFullScreen { 626 - (void)fullScreenModeChanged:(bool)isFullScreen {
632 NSWindow* window = [self window]; 627 NSWindow* window = [self window];
633 [window setLevel:(isFullScreen ? NSNormalWindowLevel : NSStatusWindowLevel)]; 628 [window setLevel:(isFullScreen ? NSNormalWindowLevel : NSStatusWindowLevel)];
634 } 629 }
635 630
636 - (BOOL)canBecomeKeyWindow { 631 - (BOOL)canBecomeKeyWindow {
637 // Panel can only gain focus if it is expanded. Minimized panels do not 632 // Panel can only gain focus if it is expanded. Minimized panels do not
638 // participate in Cmd-~ rotation. 633 // participate in Cmd-~ rotation.
639 // TODO(dimich): If it will be ever desired to expand/focus the Panel on 634 // TODO(dimich): If it will be ever desired to expand/focus the Panel on
640 // keyboard navigation or via main menu, the care should be taken to avoid 635 // keyboard navigation or via main menu, the care should be taken to avoid
641 // cases when minimized Panel is getting keyboard input, invisibly. 636 // cases when minimized Panel is getting keyboard input, invisibly.
642 return canBecomeKeyWindow_; 637 return windowShim_->panel()->expansion_state() == Panel::EXPANDED;
643 } 638 }
644 @end 639 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_window_controller_cocoa.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698