| Index: chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| diff --git a/chrome/browser/ui/cocoa/browser_window_cocoa.mm b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| index 5faefc7418f4eef97825059f7abeb76cde9ba57e..42c222a6a3d5a88038ecee16cc256e2b6a62c25c 100644
|
| --- a/chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| +++ b/chrome/browser/ui/cocoa/browser_window_cocoa.mm
|
| @@ -44,11 +44,11 @@
|
| #include "grit/chromium_strings.h"
|
| #include "grit/generated_resources.h"
|
| #include "ui/base/l10n/l10n_util_mac.h"
|
| +#include "ui/base/ui_base_types.h"
|
| #include "ui/gfx/rect.h"
|
|
|
| BrowserWindowCocoa::BrowserWindowCocoa(Browser* browser,
|
| - BrowserWindowController* controller,
|
| - NSWindow* window)
|
| + BrowserWindowController* controller)
|
| : browser_(browser),
|
| controller_(controller),
|
| confirm_close_factory_(browser) {
|
| @@ -73,11 +73,28 @@ void BrowserWindowCocoa::Show() {
|
| // the previous browser instead if we don't explicitly set it here.
|
| BrowserList::SetLastActive(browser_);
|
|
|
| - [window() makeKeyAndOrderFront:controller_];
|
| + ui::WindowShowState show_state = browser_->GetSavedWindowShowState();
|
| + if (show_state == ui::SHOW_STATE_MINIMIZED) {
|
| + // Turn off swishing when restoring minimized windows. When creating
|
| + // windows from nibs it is necessary to |orderFront:| prior to |orderOut:|
|
| + // then |miniaturize:| when restoring windows in the minimized state.
|
| + if ([window() respondsToSelector:@selector(setAnimationBehavior:)])
|
| + [window() setAnimationBehavior:NSWindowAnimationBehaviorNone];
|
| +
|
| + [window() makeKeyAndOrderFront:controller_];
|
| +
|
| + [window() orderOut:controller_];
|
| + [window() miniaturize:controller_];
|
| +
|
| + if ([window() respondsToSelector:@selector(setAnimationBehavior:)])
|
| + [window() setAnimationBehavior:NSWindowAnimationBehaviorDocumentWindow];
|
| + } else {
|
| + [window() makeKeyAndOrderFront:controller_];
|
| + }
|
| }
|
|
|
| void BrowserWindowCocoa::ShowInactive() {
|
| - [window() orderFront:controller_];
|
| + [window() orderFront:controller_];
|
| }
|
|
|
| void BrowserWindowCocoa::SetBounds(const gfx::Rect& bounds) {
|
| @@ -214,6 +231,10 @@ bool BrowserWindowCocoa::IsMaximized() const {
|
| return [window() isZoomed];
|
| }
|
|
|
| +bool BrowserWindowCocoa::IsMinimized() const {
|
| + return [window() isMiniaturized];
|
| +}
|
| +
|
| void BrowserWindowCocoa::SetFullscreen(bool fullscreen) {
|
| [controller_ setFullscreen:fullscreen];
|
| }
|
|
|