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 #import "base/auto_reset.h" | 9 #import "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 // |windowScreen| can be nil (for example, if the monitor arrangement was | 150 // |windowScreen| can be nil (for example, if the monitor arrangement was |
151 // changed while in fullscreen mode). If we see a nil screen, return without | 151 // changed while in fullscreen mode). If we see a nil screen, return without |
152 // saving. | 152 // saving. |
153 // TODO(rohitrao): We should just not save anything for fullscreen windows. | 153 // TODO(rohitrao): We should just not save anything for fullscreen windows. |
154 // http://crbug.com/36479. | 154 // http://crbug.com/36479. |
155 if (!windowScreen) | 155 if (!windowScreen) |
156 return; | 156 return; |
157 | 157 |
158 // Only save main window information to preferences. | 158 // Only save main window information to preferences. |
159 PrefService* prefs = browser_->profile()->GetPrefs(); | 159 PrefService* prefs = browser_->profile()->GetPrefs(); |
160 if (!prefs || browser_ != chrome::GetLastActiveBrowser()) | 160 if (!prefs || browser_.get() != chrome::GetLastActiveBrowser()) |
161 return; | 161 return; |
162 | 162 |
163 // Save the current work area, in flipped coordinates. | 163 // Save the current work area, in flipped coordinates. |
164 gfx::Rect workArea(NSRectToCGRect([windowScreen visibleFrame])); | 164 gfx::Rect workArea(NSRectToCGRect([windowScreen visibleFrame])); |
165 workArea.set_y(monitorFrame.size.height - workArea.y() - workArea.height()); | 165 workArea.set_y(monitorFrame.size.height - workArea.y() - workArea.height()); |
166 | 166 |
167 scoped_ptr<DictionaryPrefUpdate> update = | 167 scoped_ptr<DictionaryPrefUpdate> update = |
168 chrome::GetWindowPlacementDictionaryReadWrite( | 168 chrome::GetWindowPlacementDictionaryReadWrite( |
169 chrome::GetWindowName(browser_.get()), | 169 chrome::GetWindowName(browser_.get()), |
170 browser_->profile()->GetPrefs()); | 170 browser_->profile()->GetPrefs()); |
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 return browser_->tab_strip_model()->GetActiveWebContents(); | 1216 return browser_->tab_strip_model()->GetActiveWebContents(); |
1217 } | 1217 } |
1218 | 1218 |
1219 - (PermissionBubbleManager*)permissionBubbleManager { | 1219 - (PermissionBubbleManager*)permissionBubbleManager { |
1220 if (WebContents* contents = [self webContents]) | 1220 if (WebContents* contents = [self webContents]) |
1221 return PermissionBubbleManager::FromWebContents(contents); | 1221 return PermissionBubbleManager::FromWebContents(contents); |
1222 return nil; | 1222 return nil; |
1223 } | 1223 } |
1224 | 1224 |
1225 @end // @implementation BrowserWindowController(Private) | 1225 @end // @implementation BrowserWindowController(Private) |
OLD | NEW |