| 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 return nil; | 145 return nil; |
| 146 } | 146 } |
| 147 | 147 |
| 148 - (void)dealloc { | 148 - (void)dealloc { |
| 149 self.contentViewProxy.contentView = nil; | 149 self.contentViewProxy.contentView = nil; |
| 150 [super dealloc]; | 150 [super dealloc]; |
| 151 } | 151 } |
| 152 | 152 |
| 153 #pragma mark Accessors | 153 #pragma mark Accessors |
| 154 | 154 |
| 155 - (id<CRWWebControllerContainerViewDelegate>)delegate { |
| 156 return _delegate.get(); |
| 157 } |
| 158 |
| 159 - (void)setDelegate:(id<CRWWebControllerContainerViewDelegate>)delegate { |
| 160 _delegate.reset(delegate); |
| 161 } |
| 162 |
| 155 - (CRWWebViewContentView*)webViewContentView { | 163 - (CRWWebViewContentView*)webViewContentView { |
| 156 return _webViewContentView.get(); | 164 return _webViewContentView.get(); |
| 157 } | 165 } |
| 158 | 166 |
| 159 - (void)setWebViewContentView:(CRWWebViewContentView*)webViewContentView { | 167 - (void)setWebViewContentView:(CRWWebViewContentView*)webViewContentView { |
| 160 if (![_webViewContentView isEqual:webViewContentView]) { | 168 if (![_webViewContentView isEqual:webViewContentView]) { |
| 161 [_webViewContentView removeFromSuperview]; | 169 [_webViewContentView removeFromSuperview]; |
| 162 _webViewContentView.reset([webViewContentView retain]); | 170 _webViewContentView.reset([webViewContentView retain]); |
| 163 [_webViewContentView setFrame:self.bounds]; | 171 [_webViewContentView setFrame:self.bounds]; |
| 164 [self addSubview:_webViewContentView]; | 172 [self addSubview:_webViewContentView]; |
| (...skipping 162 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 |