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

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2710913006: Removed -[CRWWebDelegate webController:titleDidChange:]. (Closed)
Patch Set: Rebased Created 3 years, 10 months 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 side-by-side diff with in-line comments
Download patch
Index: ios/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index a232f4c6e8a24fcfb9d422fb415c1124af01ad54..ac37f12652268b7f29aef8692939f3aadfd5f158 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -1019,12 +1019,8 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
- (void)setDelegate:(id<CRWWebDelegate>)delegate {
_delegate.reset(delegate);
- if ([self.nativeController respondsToSelector:@selector(setDelegate:)]) {
- if ([_delegate respondsToSelector:@selector(webController:titleDidChange:)])
- [self.nativeController setDelegate:self];
- else
- [self.nativeController setDelegate:nil];
- }
+ if ([self.nativeController respondsToSelector:@selector(setDelegate:)])
+ [self.nativeController setDelegate:self];
}
- (void)dealloc {
@@ -1086,8 +1082,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
// NativeControllerDelegate method, called to inform that title has changed.
- (void)nativeContent:(id)content titleDidChange:(NSString*)title {
- // Responsiveness to delegate method was checked in setDelegate:.
- [_delegate webController:self titleDidChange:title];
+ _webStateImpl->OnTitleChanged();
}
- (void)setNativeControllerWebUsageEnabled:(BOOL)webUsageEnabled {
@@ -1375,10 +1370,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
// other platforms send this (tab sync triggers need to be compared against
// upstream).
self.navigationManagerImpl->OnNavigationItemChanged();
-
- if ([_delegate respondsToSelector:@selector(webController:titleDidChange:)]) {
- [_delegate webController:self titleDidChange:title];
- }
+ _webStateImpl->OnTitleChanged();
}
- (BOOL)isCurrentNavigationItemPOST {
@@ -1803,15 +1795,12 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
[self didFinishWithURL:currentURL loadSuccess:loadSuccess];
NSString* title = [self.nativeController title];
- if (title)
+ if (title) {
[self setNavigationItemTitle:title];
+ }
- // If the controller handles title change notification, route those to the
- // delegate.
- if ([_delegate respondsToSelector:@selector(webController:titleDidChange:)]) {
- if ([self.nativeController respondsToSelector:@selector(setDelegate:)]) {
- [self.nativeController setDelegate:self];
- }
+ if ([self.nativeController respondsToSelector:@selector(setDelegate:)]) {
+ [self.nativeController setDelegate:self];
}
}
« no previous file with comments | « ios/web/public/web_state/web_state_observer_bridge.h ('k') | ios/web/web_state/ui/crw_web_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698