| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/web/web_state/ui/crw_web_controller_container_view.h" | 5 #import "ios/web/web_state/ui/crw_web_controller_container_view.h" |
| 6 | 6 |
| 7 #include "base/ios/weak_nsobject.h" | 7 #include "base/ios/weak_nsobject.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
| 10 #import "ios/web/public/web_state/ui/crw_content_view.h" | 10 #import "ios/web/public/web_state/ui/crw_content_view.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 - (CRWWebViewProxyImpl*)contentViewProxy { | 205 - (CRWWebViewProxyImpl*)contentViewProxy { |
| 206 return [_delegate contentViewProxyForContainerView:self]; | 206 return [_delegate contentViewProxyForContainerView:self]; |
| 207 } | 207 } |
| 208 | 208 |
| 209 - (CGRect)visibleFrame { | 209 - (CGRect)visibleFrame { |
| 210 CGFloat headerHeight = [_delegate headerHeightForContainerView:self]; | 210 CGFloat headerHeight = [_delegate headerHeightForContainerView:self]; |
| 211 return UIEdgeInsetsInsetRect(self.bounds, | 211 return UIEdgeInsetsInsetRect(self.bounds, |
| 212 UIEdgeInsetsMake(headerHeight, 0, 0, 0)); | 212 UIEdgeInsetsMake(headerHeight, 0, 0, 0)); |
| 213 } | 213 } |
| 214 | 214 |
| 215 - (id<CRWWebControllerContainerViewDelegate>)delegate { |
| 216 return _delegate.get(); |
| 217 } |
| 218 |
| 219 - (void)setDelegate:(id<CRWWebControllerContainerViewDelegate>)delegate { |
| 220 _delegate.reset(delegate); |
| 221 } |
| 222 |
| 215 #pragma mark Layout | 223 #pragma mark Layout |
| 216 | 224 |
| 217 - (void)layoutSubviews { | 225 - (void)layoutSubviews { |
| 218 [super layoutSubviews]; | 226 [super layoutSubviews]; |
| 219 | 227 |
| 220 self.webViewContentView.frame = self.bounds; | 228 self.webViewContentView.frame = self.bounds; |
| 221 | 229 |
| 222 // TODO(crbug.com/570114): Move adding of the following subviews to another | 230 // TODO(crbug.com/570114): Move adding of the following subviews to another |
| 223 // place. | 231 // place. |
| 224 | 232 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 else | 335 else |
| 328 self.toolbarContainerView = nil; | 336 self.toolbarContainerView = nil; |
| 329 } | 337 } |
| 330 | 338 |
| 331 - (void)removeAllToolbars { | 339 - (void)removeAllToolbars { |
| 332 // Resetting the property will remove the toolbars from the hierarchy. | 340 // Resetting the property will remove the toolbars from the hierarchy. |
| 333 self.toolbarContainerView = nil; | 341 self.toolbarContainerView = nil; |
| 334 } | 342 } |
| 335 | 343 |
| 336 @end | 344 @end |
| OLD | NEW |