Chromium Code Reviews| Index: chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm |
| diff --git a/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm b/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm |
| index ef8f353c82710ae384193c676ff2080e562b52bb..9587aa0566bdb979191a9bd266d481c30549add3 100644 |
| --- a/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm |
| +++ b/chrome/browser/ui/cocoa/panels/panel_window_controller_cocoa.mm |
| @@ -588,6 +588,12 @@ const double kWidthOfMouseResizeArea = 15.0; |
| // whether it's refactoring more things into BrowserWindowUtils or making a |
| // common base controller for browser windows. |
| - (void)windowDidBecomeKey:(NSNotification*)notification { |
| + // Prevent the minimized panel from invoking any activation logic. This is |
|
Dmitry Titov
2014/05/16 16:37:38
I'm not sure I understand the change being made. I
jianli
2014/05/20 00:56:00
We do instruct canBecomeKeyWindow to return NO bu
|
| + // because Cocoa does not support deactivating a window and it could still |
| + // try to activate the minimized panel window. |
| + if (windowShim_->panel()->IsMinimized()) |
| + return; |
| + |
| // We need to activate the controls (in the "WebView"). To do this, get the |
| // selected WebContents's RenderWidgetHostView and tell it to activate. |
| if (WebContents* contents = windowShim_->panel()->GetWebContents()) { |
| @@ -612,13 +618,6 @@ const double kWidthOfMouseResizeArea = 15.0; |
| return; |
| [self onWindowDidResignKey]; |
| - |
| - // Make the window not user-resizable when it loses the focus. This is to |
| - // solve the problem that the bottom edge of the active panel does not |
| - // trigger the user-resizing if this panel stacks with another inactive |
| - // panel at the bottom. |
| - [[self window] setStyleMask: |
| - [[self window] styleMask] & ~NSResizableWindowMask]; |
| } |
| - (void)windowWillStartLiveResize:(NSNotification*)notification { |
| @@ -741,6 +740,13 @@ const double kWidthOfMouseResizeArea = 15.0; |
| } |
| windowShim_->panel()->OnActiveStateChanged(false); |
| + |
| + // Make the window not user-resizable when it loses the focus. This is to |
| + // solve the problem that the bottom edge of the active panel does not |
| + // trigger the user-resizing if this panel stacks with another inactive |
| + // panel at the bottom. |
| + [[self window] setStyleMask: |
| + [[self window] styleMask] & ~NSResizableWindowMask]; |
| } |
| - (void)preventBecomingKeyWindow:(BOOL)prevent { |