Chromium Code Reviews| 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/tabs/tab_window_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "chrome/browser/ui/cocoa/browser_window_layout.h" | 8 #import "chrome/browser/ui/cocoa/browser_window_layout.h" |
| 9 #import "chrome/browser/ui/cocoa/fast_resize_view.h" | 9 #import "chrome/browser/ui/cocoa/fast_resize_view.h" |
| 10 #import "chrome/browser/ui/cocoa/framed_browser_window.h" | 10 #import "chrome/browser/ui/cocoa/framed_browser_window.h" |
| 11 #import "chrome/browser/ui/cocoa/tabs/tab_strip_background_view.h" | |
| 11 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" | 12 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" |
| 12 #import "chrome/browser/ui/cocoa/themed_window.h" | 13 #import "chrome/browser/ui/cocoa/themed_window.h" |
| 13 #import "chrome/browser/ui/cocoa/version_independent_window.h" | 14 #import "chrome/browser/ui/cocoa/version_independent_window.h" |
| 14 #import "ui/base/cocoa/focus_tracker.h" | 15 #import "ui/base/cocoa/focus_tracker.h" |
| 15 #include "ui/base/theme_provider.h" | 16 #include "ui/base/theme_provider.h" |
| 16 | 17 |
| 17 @interface TabWindowController(PRIVATE) | 18 @interface TabWindowController(PRIVATE) |
| 18 - (void)setUseOverlay:(BOOL)useOverlay; | 19 - (void)setUseOverlay:(BOOL)useOverlay; |
| 19 @end | 20 @end |
| 20 | 21 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 58 | 59 |
| 59 if ((self = [super initWithWindow:window])) { | 60 if ((self = [super initWithWindow:window])) { |
| 60 [[self window] setDelegate:self]; | 61 [[self window] setDelegate:self]; |
| 61 | 62 |
| 62 tabContentArea_.reset([[FastResizeView alloc] initWithFrame: | 63 tabContentArea_.reset([[FastResizeView alloc] initWithFrame: |
| 63 NSMakeRect(0, 0, 750, 600)]); | 64 NSMakeRect(0, 0, 750, 600)]); |
| 64 [tabContentArea_ setAutoresizingMask:NSViewWidthSizable | | 65 [tabContentArea_ setAutoresizingMask:NSViewWidthSizable | |
| 65 NSViewHeightSizable]; | 66 NSViewHeightSizable]; |
| 66 [[[self window] contentView] addSubview:tabContentArea_]; | 67 [[[self window] contentView] addSubview:tabContentArea_]; |
| 67 | 68 |
| 69 // tabStripBackgroundView_ draws the theme image behind the tab strip area. | |
| 70 // When making a tab dragging window (setUseOverlay:), this view stays in | |
| 71 // the parent window so that it can be translucent, while the tab strip view | |
| 72 // moves to the child window and stays opaque. | |
| 73 NSView* windowView = [window cr_windowView]; | |
| 74 tabStripBackgroundView_.reset([[TabStripBackgroundView alloc] | |
|
erikchen
2014/09/27 00:23:33
When the tab strip gets moved to another window (e
Andre
2014/09/27 18:17:02
I don't think this view needs to be moved.
Fullscr
| |
| 75 initWithFrame:NSMakeRect(0, | |
| 76 NSMaxY([windowView bounds]) - | |
| 77 kBrowserFrameViewPaintHeight, | |
| 78 NSWidth([windowView bounds]), | |
| 79 kBrowserFrameViewPaintHeight)]); | |
| 80 [tabStripBackgroundView_ | |
| 81 setAutoresizingMask:NSViewWidthSizable | NSViewMinYMargin]; | |
| 82 [windowView addSubview:tabStripBackgroundView_ | |
| 83 positioned:NSWindowBelow | |
| 84 relativeTo:nil]; | |
| 85 | |
| 68 tabStripView_.reset([[TabStripView alloc] | 86 tabStripView_.reset([[TabStripView alloc] |
| 69 initWithFrame:NSMakeRect(0, 0, 750, chrome::kTabStripHeight)]); | 87 initWithFrame:NSMakeRect(0, 0, 750, chrome::kTabStripHeight)]); |
| 70 [tabStripView_ setAutoresizingMask:NSViewWidthSizable | | 88 [tabStripView_ setAutoresizingMask:NSViewWidthSizable | |
| 71 NSViewMinYMargin]; | 89 NSViewMinYMargin]; |
| 72 if (hasTabStrip) | 90 if (hasTabStrip) |
| 73 [self insertTabStripView:tabStripView_ intoWindow:[self window]]; | 91 [self insertTabStripView:tabStripView_ intoWindow:[self window]]; |
| 74 } | 92 } |
| 75 return self; | 93 return self; |
| 76 } | 94 } |
| 77 | 95 |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 304 } | 322 } |
| 305 } | 323 } |
| 306 | 324 |
| 307 // Called when the size of the window content area has changed. Override to | 325 // Called when the size of the window content area has changed. Override to |
| 308 // position specific views. Base class implementation does nothing. | 326 // position specific views. Base class implementation does nothing. |
| 309 - (void)layoutSubviews { | 327 - (void)layoutSubviews { |
| 310 NOTIMPLEMENTED(); | 328 NOTIMPLEMENTED(); |
| 311 } | 329 } |
| 312 | 330 |
| 313 @end | 331 @end |
| OLD | NEW |