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 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller_private.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #import "base/memory/scoped_nsobject.h" | 10 #import "base/memory/scoped_nsobject.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // Do some y twiddling to flip the coordinate system. | 94 // Do some y twiddling to flip the coordinate system. |
95 gfx::Rect bounds(NSRectToCGRect([window frame])); | 95 gfx::Rect bounds(NSRectToCGRect([window frame])); |
96 bounds.set_y(monitorFrame.size.height - bounds.y() - bounds.height()); | 96 bounds.set_y(monitorFrame.size.height - bounds.y() - bounds.height()); |
97 | 97 |
98 // Browser::SaveWindowPlacement saves information for session restore. | 98 // Browser::SaveWindowPlacement saves information for session restore. |
99 ui::WindowShowState show_state = ui::SHOW_STATE_NORMAL; | 99 ui::WindowShowState show_state = ui::SHOW_STATE_NORMAL; |
100 if ([window isMiniaturized]) | 100 if ([window isMiniaturized]) |
101 show_state = ui::SHOW_STATE_MINIMIZED; | 101 show_state = ui::SHOW_STATE_MINIMIZED; |
102 else if ([self isFullscreen]) | 102 else if ([self isFullscreen]) |
103 show_state = ui::SHOW_STATE_FULLSCREEN; | 103 show_state = ui::SHOW_STATE_FULLSCREEN; |
104 chrome::SaveWindowPlacement(browser_.get(), bounds, show_state); | 104 chrome::SaveWindowPlacement(browser_.get(), bounds, show_state, false); |
105 | 105 |
106 // |windowScreen| can be nil (for example, if the monitor arrangement was | 106 // |windowScreen| can be nil (for example, if the monitor arrangement was |
107 // changed while in fullscreen mode). If we see a nil screen, return without | 107 // changed while in fullscreen mode). If we see a nil screen, return without |
108 // saving. | 108 // saving. |
109 // TODO(rohitrao): We should just not save anything for fullscreen windows. | 109 // TODO(rohitrao): We should just not save anything for fullscreen windows. |
110 // http://crbug.com/36479. | 110 // http://crbug.com/36479. |
111 if (!windowScreen) | 111 if (!windowScreen) |
112 return; | 112 return; |
113 | 113 |
114 // Only save main window information to preferences. | 114 // Only save main window information to preferences. |
(...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
861 - (void)disableBarVisibilityUpdates { | 861 - (void)disableBarVisibilityUpdates { |
862 // Early escape if there's nothing to do. | 862 // Early escape if there's nothing to do. |
863 if (!barVisibilityUpdatesEnabled_) | 863 if (!barVisibilityUpdatesEnabled_) |
864 return; | 864 return; |
865 | 865 |
866 barVisibilityUpdatesEnabled_ = NO; | 866 barVisibilityUpdatesEnabled_ = NO; |
867 [presentationModeController_ cancelAnimationAndTimers]; | 867 [presentationModeController_ cancelAnimationAndTimers]; |
868 } | 868 } |
869 | 869 |
870 @end // @implementation BrowserWindowController(Private) | 870 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |