OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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.h" | 5 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
6 | 6 |
7 #include <cmath> | 7 #include <cmath> |
8 #include <numeric> | 8 #include <numeric> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 &desiredContentRect, | 288 &desiredContentRect, |
289 &show_state); | 289 &show_state); |
290 gfx::Rect windowRect = desiredContentRect; | 290 gfx::Rect windowRect = desiredContentRect; |
291 windowRect = [self enforceMinWindowSize:windowRect]; | 291 windowRect = [self enforceMinWindowSize:windowRect]; |
292 | 292 |
293 // When we are given x/y coordinates of 0 on a created popup window, assume | 293 // When we are given x/y coordinates of 0 on a created popup window, assume |
294 // none were given by the window.open() command. | 294 // none were given by the window.open() command. |
295 if (browser_->is_type_popup() && | 295 if (browser_->is_type_popup() && |
296 windowRect.x() == 0 && windowRect.y() == 0) { | 296 windowRect.x() == 0 && windowRect.y() == 0) { |
297 gfx::Size size = windowRect.size(); | 297 gfx::Size size = windowRect.size(); |
298 windowRect.set_origin( | 298 windowRect.set_origin(WindowSizer::GetDefaultPopupOrigin(size)); |
299 WindowSizer::GetDefaultPopupOrigin(size, | |
300 browser_->host_desktop_type())); | |
301 } | 299 } |
302 | 300 |
303 // Size and position the window. Note that it is not yet onscreen. Popup | 301 // Size and position the window. Note that it is not yet onscreen. Popup |
304 // windows may get resized later on in this function, once the actual size | 302 // windows may get resized later on in this function, once the actual size |
305 // of the toolbar/tabstrip is known. | 303 // of the toolbar/tabstrip is known. |
306 windowShim_->SetBounds(windowRect); | 304 windowShim_->SetBounds(windowRect); |
307 | 305 |
308 // Puts the incognito badge on the window frame, if necessary. | 306 // Puts the incognito badge on the window frame, if necessary. |
309 [self installAvatar]; | 307 [self installAvatar]; |
310 | 308 |
(...skipping 1798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2109 | 2107 |
2110 - (BOOL)supportsBookmarkBar { | 2108 - (BOOL)supportsBookmarkBar { |
2111 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2109 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2112 } | 2110 } |
2113 | 2111 |
2114 - (BOOL)isTabbedWindow { | 2112 - (BOOL)isTabbedWindow { |
2115 return browser_->is_type_tabbed(); | 2113 return browser_->is_type_tabbed(); |
2116 } | 2114 } |
2117 | 2115 |
2118 @end // @implementation BrowserWindowController(WindowType) | 2116 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |