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.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 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
226 initializing_ = YES; | 226 initializing_ = YES; |
227 browser_.reset(browser); | 227 browser_.reset(browser); |
228 ownsBrowser_ = ownIt; | 228 ownsBrowser_ = ownIt; |
229 NSWindow* window = [self window]; | 229 NSWindow* window = [self window]; |
230 windowShim_.reset(new BrowserWindowCocoa(browser, self)); | 230 windowShim_.reset(new BrowserWindowCocoa(browser, self)); |
231 | 231 |
232 // Create the bar visibility lock set; 10 is arbitrary, but should hopefully | 232 // Create the bar visibility lock set; 10 is arbitrary, but should hopefully |
233 // be big enough to hold all locks that'll ever be needed. | 233 // be big enough to hold all locks that'll ever be needed. |
234 barVisibilityLocks_.reset([[NSMutableSet setWithCapacity:10] retain]); | 234 barVisibilityLocks_.reset([[NSMutableSet setWithCapacity:10] retain]); |
235 | 235 |
236 // Sets the window to not have rounded corners, which prevents | 236 // Set the window to not have rounded corners, which prevents the resize |
237 // the resize control from being inset slightly and looking ugly. | 237 // control from being inset slightly and looking ugly. Only bother to do |
238 if ([window respondsToSelector:@selector(setBottomCornerRounded:)]) | 238 // this on Snow Leopard and earlier; on Lion and later all windows have |
239 // rounded bottom corners, and this won't work anyway. | |
240 if (base::mac::IsOSSnowLeopardOrEarlier() && | |
241 [window respondsToSelector:@selector(setBottomCornerRounded:)]) | |
Nico
2012/04/10 19:52:48
Is this part necessary? (just curious)
Avi (use Gerrit)
2012/04/10 20:11:23
I thought that it was and I changed it, but I beli
| |
239 [window setBottomCornerRounded:NO]; | 242 [window setBottomCornerRounded:NO]; |
240 | 243 |
241 // Lion will attempt to automagically save and restore the UI. This | 244 // Lion will attempt to automagically save and restore the UI. This |
242 // functionality appears to be leaky (or at least interacts badly with our | 245 // functionality appears to be leaky (or at least interacts badly with our |
243 // architecture) and thus BrowserWindowController never gets released. This | 246 // architecture) and thus BrowserWindowController never gets released. This |
244 // prevents the browser from being able to quit <http://crbug.com/79113>. | 247 // prevents the browser from being able to quit <http://crbug.com/79113>. |
245 if ([window respondsToSelector:@selector(setRestorable:)]) | 248 if ([window respondsToSelector:@selector(setRestorable:)]) |
246 [window setRestorable:NO]; | 249 [window setRestorable:NO]; |
247 | 250 |
248 // Get the windows to swish in on Lion. | 251 // Get the windows to swish in on Lion. |
(...skipping 1954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2203 | 2206 |
2204 - (BOOL)supportsBookmarkBar { | 2207 - (BOOL)supportsBookmarkBar { |
2205 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2208 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2206 } | 2209 } |
2207 | 2210 |
2208 - (BOOL)isTabbedWindow { | 2211 - (BOOL)isTabbedWindow { |
2209 return browser_->is_type_tabbed(); | 2212 return browser_->is_type_tabbed(); |
2210 } | 2213 } |
2211 | 2214 |
2212 @end // @implementation BrowserWindowController(WindowType) | 2215 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |