| 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 // -isZoomed returns YES if the window's frame equals the rect returned by | 366 return [window() isZoomed]; |
| 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]; | |
| 370 } | 367 } |
| 371 | 368 |
| 372 bool BrowserWindowCocoa::IsMinimized() const { | 369 bool BrowserWindowCocoa::IsMinimized() const { |
| 373 return [window() isMiniaturized]; | 370 return [window() isMiniaturized]; |
| 374 } | 371 } |
| 375 | 372 |
| 376 void BrowserWindowCocoa::Maximize() { | 373 void BrowserWindowCocoa::Maximize() { |
| 377 // Zoom toggles so only call if not already maximized. | 374 // Zoom toggles so only call if not already maximized. |
| 378 if (!IsMaximized()) | 375 if (!IsMaximized()) |
| 379 [window() zoom:controller_]; | 376 [window() zoom:controller_]; |
| (...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 834 void BrowserWindowCocoa::UnhideDownloadShelf() { | 831 void BrowserWindowCocoa::UnhideDownloadShelf() { |
| 835 GetDownloadShelf()->Unhide(); | 832 GetDownloadShelf()->Unhide(); |
| 836 } | 833 } |
| 837 | 834 |
| 838 void BrowserWindowCocoa::HideDownloadShelf() { | 835 void BrowserWindowCocoa::HideDownloadShelf() { |
| 839 GetDownloadShelf()->Hide(); | 836 GetDownloadShelf()->Hide(); |
| 840 StatusBubble* statusBubble = GetStatusBubble(); | 837 StatusBubble* statusBubble = GetStatusBubble(); |
| 841 if (statusBubble) | 838 if (statusBubble) |
| 842 statusBubble->Hide(); | 839 statusBubble->Hide(); |
| 843 } | 840 } |
| OLD | NEW |