Chromium Code Reviews| 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 6d0fb2cfa2b052059efebef06219a0dee45a6672..eb1099f7e9276597f9b5f4abcfec94a05b32a8b0 100644 |
| --- a/ios/web/web_state/ui/crw_web_controller.mm |
| +++ b/ios/web/web_state/ui/crw_web_controller.mm |
| @@ -1020,10 +1020,7 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5; |
| - (void)setDelegate:(id<CRWWebDelegate>)delegate { |
| _delegate.reset(delegate); |
| if ([self.nativeController respondsToSelector:@selector(setDelegate:)]) { |
|
kkhorimoto
2017/02/28 01:14:55
NIT: we can remove curly braces now if you want, s
Eugene But (OOO till 7-30)
2017/02/28 01:26:45
Sure. Either way is fine with me.
|
| - if ([_delegate respondsToSelector:@selector(webController:titleDidChange:)]) |
| - [self.nativeController setDelegate:self]; |
| - else |
| - [self.nativeController setDelegate:nil]; |
| + [self.nativeController setDelegate:self]; |
| } |
| } |
| @@ -1086,8 +1083,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 +1371,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 +1796,12 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5; |
| [self didFinishWithURL:currentURL loadSuccess:loadSuccess]; |
| NSString* title = [self.nativeController title]; |
| - if (title) |
| + if (title) { |
|
kkhorimoto
2017/02/28 01:14:55
NIT: curly braces not necessary here and below
Eugene But (OOO till 7-30)
2017/02/28 01:26:45
Style Guide is neutral on this issue and I choose
|
| [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]; |
| } |
| } |