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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 // The fullscreen button's position may depend on the old avatar button's | 388 // The fullscreen button's position may depend on the old avatar button's |
389 // width, but that does not require calling layoutSubviews first. | 389 // width, but that does not require calling layoutSubviews first. |
390 NSUInteger collectionBehavior = [window collectionBehavior]; | 390 NSUInteger collectionBehavior = [window collectionBehavior]; |
391 collectionBehavior |= | 391 collectionBehavior |= |
392 browser_->type() == Browser::TYPE_TABBED || | 392 browser_->type() == Browser::TYPE_TABBED || |
393 browser_->type() == Browser::TYPE_POPUP ? | 393 browser_->type() == Browser::TYPE_POPUP ? |
394 NSWindowCollectionBehaviorFullScreenPrimary : | 394 NSWindowCollectionBehaviorFullScreenPrimary : |
395 NSWindowCollectionBehaviorFullScreenAuxiliary; | 395 NSWindowCollectionBehaviorFullScreenAuxiliary; |
396 [window setCollectionBehavior:collectionBehavior]; | 396 [window setCollectionBehavior:collectionBehavior]; |
397 | 397 |
| 398 // NSTrackingInVisibleRect doesn't work correctly with Lion's window |
| 399 // resizing, http://crbug.com/176725 / |
| 400 // http://openradar.appspot.com/radar?id=2773401 . |
| 401 // Setting this property will send mouseMoved events to the window's first |
| 402 // responder, so it will avoid the problem as long as the |
| 403 // RenderWidgetHostViewCocoa is first responder. |
| 404 // The bug will still be there if the omnibox has focus (Safari suffers |
| 405 // from the same problem). |
| 406 [window setAcceptsMouseMovedEvents:YES]; |
| 407 |
398 [self layoutSubviews]; | 408 [self layoutSubviews]; |
399 | 409 |
400 // For a popup window, |desiredContentRect| contains the desired height of | 410 // For a popup window, |desiredContentRect| contains the desired height of |
401 // the content, not of the whole window. Now that all the views are laid | 411 // the content, not of the whole window. Now that all the views are laid |
402 // out, measure the current content area size and grow if needed. The | 412 // out, measure the current content area size and grow if needed. The |
403 // window has not been placed onscreen yet, so this extra resize will not | 413 // window has not been placed onscreen yet, so this extra resize will not |
404 // cause visible jank. | 414 // cause visible jank. |
405 if (browser_->is_type_popup()) { | 415 if (browser_->is_type_popup()) { |
406 CGFloat deltaH = desiredContentRect.height() - | 416 CGFloat deltaH = desiredContentRect.height() - |
407 NSHeight([[self tabContentArea] frame]); | 417 NSHeight([[self tabContentArea] frame]); |
(...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2235 | 2245 |
2236 - (BOOL)supportsBookmarkBar { | 2246 - (BOOL)supportsBookmarkBar { |
2237 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; | 2247 return [self supportsWindowFeature:Browser::FEATURE_BOOKMARKBAR]; |
2238 } | 2248 } |
2239 | 2249 |
2240 - (BOOL)isTabbedWindow { | 2250 - (BOOL)isTabbedWindow { |
2241 return browser_->is_type_tabbed(); | 2251 return browser_->is_type_tabbed(); |
2242 } | 2252 } |
2243 | 2253 |
2244 @end // @implementation BrowserWindowController(WindowType) | 2254 @end // @implementation BrowserWindowController(WindowType) |
OLD | NEW |