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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_cocoa.mm

Issue 1055893003: Fix docked browser window sometimes appears onscreen after restart (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm » ('j') | 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/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
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
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 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/browser_window_cocoa_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698