OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/tab_contents/overlayable_contents_controller.h" | 5 #import "chrome/browser/ui/cocoa/tab_contents/overlayable_contents_controller.h" |
6 | 6 |
7 #include "base/mac/bundle_locations.h" | 7 #include "base/mac/bundle_locations.h" |
8 #include "chrome/browser/ui/cocoa/browser_window_controller.h" | 8 #include "chrome/browser/ui/cocoa/browser_window_controller.h" |
9 #include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h" | 9 #include "chrome/browser/ui/cocoa/tab_contents/instant_overlay_controller_mac.h" |
10 #include "chrome/browser/ui/cocoa/tab_contents/overlay_separator_view.h" | 10 #include "chrome/browser/ui/cocoa/tab_contents/overlay_separator_view.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 } | 123 } |
124 | 124 |
125 - (BOOL)isShowingOverlay { | 125 - (BOOL)isShowingOverlay { |
126 return overlayContents_ != nil; | 126 return overlayContents_ != nil; |
127 } | 127 } |
128 | 128 |
129 - (InstantOverlayControllerMac*)instantOverlayController { | 129 - (InstantOverlayControllerMac*)instantOverlayController { |
130 return instantOverlayController_.get(); | 130 return instantOverlayController_.get(); |
131 } | 131 } |
132 | 132 |
| 133 - (void)onWebContentsDestroyed:(content::WebContents*)webContents { |
| 134 if (overlayContents_ == webContents) { |
| 135 [overlayContents_->GetView()->GetNativeView() removeFromSuperview]; |
| 136 overlayContents_ = NULL; |
| 137 } |
| 138 } |
| 139 |
133 - (NSView*)activeContainer { | 140 - (NSView*)activeContainer { |
134 return activeContainer_.get(); | 141 return activeContainer_.get(); |
135 } | 142 } |
136 | 143 |
137 - (NSView*)dropShadowView { | 144 - (NSView*)dropShadowView { |
138 return dropShadowView_.get(); | 145 return dropShadowView_.get(); |
139 } | 146 } |
140 | 147 |
141 - (void)setActiveContainerOffset:(CGFloat)activeContainerOffset { | 148 - (void)setActiveContainerOffset:(CGFloat)activeContainerOffset { |
142 if (activeContainerOffset_ == activeContainerOffset) | 149 if (activeContainerOffset_ == activeContainerOffset) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 | 226 |
220 if (![windowController_ hasToolbar]) | 227 if (![windowController_ hasToolbar]) |
221 return NO; | 228 return NO; |
222 | 229 |
223 // Show a separator is the overlay or the tab contents will be shown right | 230 // Show a separator is the overlay or the tab contents will be shown right |
224 // next to the omnibox. | 231 // next to the omnibox. |
225 return activeContainerOffset_ == 0 || overlayContents_; | 232 return activeContainerOffset_ == 0 || overlayContents_; |
226 } | 233 } |
227 | 234 |
228 @end | 235 @end |
OLD | NEW |