| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // Load the browser window nib and do any Cocoa-specific initialization. | 225 // Load the browser window nib and do any Cocoa-specific initialization. |
| 226 // Takes ownership of |browser|. Note that the nib also sets this controller | 226 // Takes ownership of |browser|. Note that the nib also sets this controller |
| 227 // up as the window's delegate. | 227 // up as the window's delegate. |
| 228 - (id)initWithBrowser:(Browser*)browser { | 228 - (id)initWithBrowser:(Browser*)browser { |
| 229 return [self initWithBrowser:browser takeOwnership:YES]; | 229 return [self initWithBrowser:browser takeOwnership:YES]; |
| 230 } | 230 } |
| 231 | 231 |
| 232 // Private(TestingAPI) init routine with testing options. | 232 // Private(TestingAPI) init routine with testing options. |
| 233 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt { | 233 - (id)initWithBrowser:(Browser*)browser takeOwnership:(BOOL)ownIt { |
| 234 bool hasTabStrip = browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); | 234 bool hasTabStrip = browser->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); |
| 235 if ((self = [super initTabWindowControllerWithTabStrip:hasTabStrip])) { | 235 bool hasTitleBar = browser->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); |
| 236 if ((self = [super initTabWindowControllerWithTabStrip:hasTabStrip |
| 237 titleBar:hasTitleBar])) { |
| 236 DCHECK(browser); | 238 DCHECK(browser); |
| 237 initializing_ = YES; | 239 initializing_ = YES; |
| 238 browser_.reset(browser); | 240 browser_.reset(browser); |
| 239 ownsBrowser_ = ownIt; | 241 ownsBrowser_ = ownIt; |
| 240 NSWindow* window = [self window]; | 242 NSWindow* window = [self window]; |
| 241 SetUpBrowserWindowCommandHandler(window); | 243 SetUpBrowserWindowCommandHandler(window); |
| 242 | 244 |
| 243 // Make the content view for the window have a layer. This will make all | 245 // Make the content view for the window have a layer. This will make all |
| 244 // sub-views have layers. This is necessary to ensure correct layer | 246 // sub-views have layers. This is necessary to ensure correct layer |
| 245 // ordering of all child views and their layers. | 247 // ordering of all child views and their layers. |
| (...skipping 1816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2062 | 2064 |
| 2063 - (BOOL)isTabbedWindow { | 2065 - (BOOL)isTabbedWindow { |
| 2064 return browser_->is_type_tabbed(); | 2066 return browser_->is_type_tabbed(); |
| 2065 } | 2067 } |
| 2066 | 2068 |
| 2067 - (NSRect)savedRegularWindowFrame { | 2069 - (NSRect)savedRegularWindowFrame { |
| 2068 return savedRegularWindowFrame_; | 2070 return savedRegularWindowFrame_; |
| 2069 } | 2071 } |
| 2070 | 2072 |
| 2071 @end // @implementation BrowserWindowController(WindowType) | 2073 @end // @implementation BrowserWindowController(WindowType) |
| OLD | NEW |