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/cocoa/browser_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 if (IsMinimized()) | 356 if (IsMinimized()) |
357 return ui::SHOW_STATE_MINIMIZED; | 357 return ui::SHOW_STATE_MINIMIZED; |
358 return ui::SHOW_STATE_NORMAL; | 358 return ui::SHOW_STATE_NORMAL; |
359 } | 359 } |
360 | 360 |
361 gfx::Rect BrowserWindowCocoa::GetBounds() const { | 361 gfx::Rect BrowserWindowCocoa::GetBounds() const { |
362 return GetRestoredBounds(); | 362 return GetRestoredBounds(); |
363 } | 363 } |
364 | 364 |
365 bool BrowserWindowCocoa::IsMaximized() const { | 365 bool BrowserWindowCocoa::IsMaximized() const { |
366 return [window() isZoomed]; | 366 // -isZoomed returns YES if the window's frame equals the rect returned by |
| 367 // -windowWillUseStandardFrame:defaultFrame:, even if the window is in the |
| 368 // dock, so have to explicitly check for miniaturization state first. |
| 369 return ![window() isMiniaturized] && [window() isZoomed]; |
367 } | 370 } |
368 | 371 |
369 bool BrowserWindowCocoa::IsMinimized() const { | 372 bool BrowserWindowCocoa::IsMinimized() const { |
370 return [window() isMiniaturized]; | 373 return [window() isMiniaturized]; |
371 } | 374 } |
372 | 375 |
373 void BrowserWindowCocoa::Maximize() { | 376 void BrowserWindowCocoa::Maximize() { |
374 // Zoom toggles so only call if not already maximized. | 377 // Zoom toggles so only call if not already maximized. |
375 if (!IsMaximized()) | 378 if (!IsMaximized()) |
376 [window() zoom:controller_]; | 379 [window() zoom:controller_]; |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
831 void BrowserWindowCocoa::UnhideDownloadShelf() { | 834 void BrowserWindowCocoa::UnhideDownloadShelf() { |
832 GetDownloadShelf()->Unhide(); | 835 GetDownloadShelf()->Unhide(); |
833 } | 836 } |
834 | 837 |
835 void BrowserWindowCocoa::HideDownloadShelf() { | 838 void BrowserWindowCocoa::HideDownloadShelf() { |
836 GetDownloadShelf()->Hide(); | 839 GetDownloadShelf()->Hide(); |
837 StatusBubble* statusBubble = GetStatusBubble(); | 840 StatusBubble* statusBubble = GetStatusBubble(); |
838 if (statusBubble) | 841 if (statusBubble) |
839 statusBubble->Hide(); | 842 statusBubble->Hide(); |
840 } | 843 } |
OLD | NEW |