| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 255 |
| 256 // Private(TestingAPI) init routine with testing options. | 256 // Private(TestingAPI) init routine with testing options. |
| 257 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt { | 257 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt { |
| 258 bool hasTabStrip = browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); | 258 bool hasTabStrip = browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); |
| 259 if ((self = [super initTabWindowControllerWithTabStrip:hasTabStrip])) { | 259 if ((self = [super initTabWindowControllerWithTabStrip:hasTabStrip])) { |
| 260 DCHECK(browser); | 260 DCHECK(browser); |
| 261 initializing_ = YES; | 261 initializing_ = YES; |
| 262 browser_.reset(browser); | 262 browser_.reset(browser); |
| 263 ownsBrowser_ = ownIt; | 263 ownsBrowser_ = ownIt; |
| 264 NSWindow* window = [self window]; | 264 NSWindow* window = [self window]; |
| 265 // Make the content view for the window have a layer. This will make all |
| 266 // sub-views have layers. This is necessary to ensure correct layer |
| 267 // ordering of all child views and their layers. |
| 268 [[window contentView] cr_setWantsLayer:YES]; |
| 265 windowShim_.reset(new BrowserWindowCocoa(browser, self)); | 269 windowShim_.reset(new BrowserWindowCocoa(browser, self)); |
| 266 | 270 |
| 267 // Set different minimum sizes on tabbed windows vs non-tabbed, e.g. popups. | 271 // Set different minimum sizes on tabbed windows vs non-tabbed, e.g. popups. |
| 268 // This has to happen before -enforceMinWindowSize: is called further down. | 272 // This has to happen before -enforceMinWindowSize: is called further down. |
| 269 NSSize minSize = [self isTabbedWindow] ? | 273 NSSize minSize = [self isTabbedWindow] ? |
| 270 NSMakeSize(400, 272) : NSMakeSize(100, 122); | 274 NSMakeSize(400, 272) : NSMakeSize(100, 122); |
| 271 [[self window] setMinSize:minSize]; | 275 [[self window] setMinSize:minSize]; |
| 272 | 276 |
| 273 // Create the bar visibility lock set; 10 is arbitrary, but should hopefully | 277 // Create the bar visibility lock set; 10 is arbitrary, but should hopefully |
| 274 // be big enough to hold all locks that'll ever be needed. | 278 // be big enough to hold all locks that'll ever be needed. |
| (...skipping 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2258 | 2262 |
| 2259 - (BOOL)supportsBookmarkBar { | 2263 - (BOOL)supportsBookmarkBar { |
| 2260 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2264 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
| 2261 } | 2265 } |
| 2262 | 2266 |
| 2263 - (BOOL)isTabbedWindow { | 2267 - (BOOL)isTabbedWindow { |
| 2264 return browser_->is_type_tabbed(); | 2268 return browser_->is_type_tabbed(); |
| 2265 } | 2269 } |
| 2266 | 2270 |
| 2267 @end // @implementation BrowserWindowController(WindowType) | 2271 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |