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 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 bool hasTabStrip = browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); | 248 bool hasTabStrip = browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); |
249 if ((self = [super initTabWindowControllerWithTabStrip:hasTabStrip])) { | 249 if ((self = [super initTabWindowControllerWithTabStrip:hasTabStrip])) { |
250 DCHECK(browser); | 250 DCHECK(browser); |
251 initializing_ = YES; | 251 initializing_ = YES; |
252 browser_.reset(browser); | 252 browser_.reset(browser); |
253 ownsBrowser_ = ownIt; | 253 ownsBrowser_ = ownIt; |
254 NSWindow* window = [self window]; | 254 NSWindow* window = [self window]; |
255 // Make the content view for the window have a layer. This will make all | 255 // Make the content view for the window have a layer. This will make all |
256 // sub-views have layers. This is necessary to ensure correct layer | 256 // sub-views have layers. This is necessary to ensure correct layer |
257 // ordering of all child views and their layers. | 257 // ordering of all child views and their layers. |
258 if ([self wantsRootViewToBeLayerBacked]) | 258 [[window contentView] setWantsLayer:YES]; |
259 [[[window contentView] superview] setWantsLayer:YES]; | |
260 else | |
261 [[window contentView] setWantsLayer:YES]; | |
262 windowShim_.reset(new BrowserWindowCocoa(browser, self)); | 259 windowShim_.reset(new BrowserWindowCocoa(browser, self)); |
263 | 260 |
264 // Set different minimum sizes on tabbed windows vs non-tabbed, e.g. popups. | 261 // Set different minimum sizes on tabbed windows vs non-tabbed, e.g. popups. |
265 // This has to happen before -enforceMinWindowSize: is called further down. | 262 // This has to happen before -enforceMinWindowSize: is called further down. |
266 NSSize minSize = [self isTabbedWindow] ? | 263 NSSize minSize = [self isTabbedWindow] ? |
267 NSMakeSize(400, 272) : NSMakeSize(100, 122); | 264 NSMakeSize(400, 272) : NSMakeSize(100, 122); |
268 [[self window] setMinSize:minSize]; | 265 [[self window] setMinSize:minSize]; |
269 | 266 |
270 // Create the bar visibility lock set; 10 is arbitrary, but should hopefully | 267 // Create the bar visibility lock set; 10 is arbitrary, but should hopefully |
271 // be big enough to hold all locks that'll ever be needed. | 268 // be big enough to hold all locks that'll ever be needed. |
(...skipping 1969 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2241 | 2238 |
2242 - (BOOL)supportsBookmarkBar { | 2239 - (BOOL)supportsBookmarkBar { |
2243 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2240 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2244 } | 2241 } |
2245 | 2242 |
2246 - (BOOL)isTabbedWindow { | 2243 - (BOOL)isTabbedWindow { |
2247 return browser_->is_type_tabbed(); | 2244 return browser_->is_type_tabbed(); |
2248 } | 2245 } |
2249 | 2246 |
2250 @end // @implementation BrowserWindowController(WindowType) | 2247 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |