Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1173)

Side by Side Diff: ios/web/web_state/ui/crw_web_controller_container_view.mm

Issue 2589213002: Add CRWNativeContent willBeDismissed. (Closed)
Patch Set: in container view Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 [_webViewContentView setFrame:self.bounds]; 163 [_webViewContentView setFrame:self.bounds];
164 [self addSubview:_webViewContentView]; 164 [self addSubview:_webViewContentView];
165 } 165 }
166 } 166 }
167 167
168 - (id<CRWNativeContent>)nativeController { 168 - (id<CRWNativeContent>)nativeController {
169 return _nativeController.get(); 169 return _nativeController.get();
170 } 170 }
171 171
172 - (void)setNativeController:(id<CRWNativeContent>)nativeController { 172 - (void)setNativeController:(id<CRWNativeContent>)nativeController {
173 if ([_nativeController respondsToSelector:@selector(willBeDismissed)]) {
Eugene But (OOO till 7-30) 2016/12/21 15:26:35 Should this be moved inside |(![_nativeController
Olivier 2016/12/21 15:41:11 The logic is to call in any navigation. If the nat
Olivier 2016/12/21 15:51:36 Done.
174 [_nativeController willBeDismissed];
175 }
173 if (![_nativeController isEqual:nativeController]) { 176 if (![_nativeController isEqual:nativeController]) {
174 base::WeakNSProtocol<id> oldController(_nativeController); 177 base::WeakNSProtocol<id> oldController(_nativeController);
175 [[oldController view] removeFromSuperview]; 178 [[oldController view] removeFromSuperview];
176 _nativeController.reset([nativeController retain]); 179 _nativeController.reset([nativeController retain]);
177 // TODO(crbug.com/503297): Re-enable this DCHECK once native controller 180 // TODO(crbug.com/503297): Re-enable this DCHECK once native controller
178 // leaks are fixed. 181 // leaks are fixed.
179 // DCHECK(!oldController); 182 // DCHECK(!oldController);
180 } 183 }
181 } 184 }
182 185
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 else 338 else
336 self.toolbarContainerView = nil; 339 self.toolbarContainerView = nil;
337 } 340 }
338 341
339 - (void)removeAllToolbars { 342 - (void)removeAllToolbars {
340 // Resetting the property will remove the toolbars from the hierarchy. 343 // Resetting the property will remove the toolbars from the hierarchy.
341 self.toolbarContainerView = nil; 344 self.toolbarContainerView = nil;
342 } 345 }
343 346
344 @end 347 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698