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/fast_resize_view.h" | 8 #import "chrome/browser/ui/cocoa/fast_resize_view.h" |
9 #import "chrome/browser/ui/cocoa/framed_browser_window.h" | 9 #import "chrome/browser/ui/cocoa/framed_browser_window.h" |
10 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" | 10 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
81 return tabContentArea_; | 81 return tabContentArea_; |
82 } | 82 } |
83 | 83 |
84 // Add the top tab strop to the window, above the content box and add it to the | 84 // Add the top tab strop to the window, above the content box and add it to the |
85 // view hierarchy as a sibling of the content view so it can overlap with the | 85 // view hierarchy as a sibling of the content view so it can overlap with the |
86 // window frame. | 86 // window frame. |
87 - (void)addTabStripToWindow { | 87 - (void)addTabStripToWindow { |
88 // The frame doesn't matter. This class relies on subclasses to do tab strip | 88 // The frame doesn't matter. This class relies on subclasses to do tab strip |
89 // layout. | 89 // layout. |
90 NSView* contentParent = [[self window] cr_windowView]; | 90 NSView* contentParent = [[self window] cr_windowView]; |
91 [contentParent addSubview:tabStripView_]; | 91 if (contentParent == [[[self window] contentView] superview]) { |
92 // Add the tab strip directly above the content view, if they are siblings. | |
93 [contentParent addSubview:tabStripView_ | |
94 positioned:NSWindowAbove | |
95 relativeTo:[[self window] contentView]]; | |
Andre
2014/08/30 01:38:02
We also mess with tabStripView in -[BrowserWindowC
erikchen
2014/09/02 17:35:57
yup. also have to do something similar for making
| |
96 } else { | |
97 [contentParent addSubview:tabStripView_]; | |
98 } | |
92 } | 99 } |
93 | 100 |
94 - (void)removeOverlay { | 101 - (void)removeOverlay { |
95 [self setUseOverlay:NO]; | 102 [self setUseOverlay:NO]; |
96 if (closeDeferred_) { | 103 if (closeDeferred_) { |
97 // See comment in BrowserWindowCocoa::Close() about orderOut:. | 104 // See comment in BrowserWindowCocoa::Close() about orderOut:. |
98 [[self window] orderOut:self]; | 105 [[self window] orderOut:self]; |
99 [[self window] performClose:self]; // Autoreleases the controller. | 106 [[self window] performClose:self]; // Autoreleases the controller. |
100 } | 107 } |
101 } | 108 } |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
292 closeDeferred_ = YES; | 299 closeDeferred_ = YES; |
293 } | 300 } |
294 | 301 |
295 // Called when the size of the window content area has changed. Override to | 302 // Called when the size of the window content area has changed. Override to |
296 // position specific views. Base class implementation does nothing. | 303 // position specific views. Base class implementation does nothing. |
297 - (void)layoutSubviews { | 304 - (void)layoutSubviews { |
298 NOTIMPLEMENTED(); | 305 NOTIMPLEMENTED(); |
299 } | 306 } |
300 | 307 |
301 @end | 308 @end |
OLD | NEW |