OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/chrome/browser/ui/browser_view_controller.h" | 5 #import "ios/chrome/browser/ui/browser_view_controller.h" |
6 | 6 |
7 #import <AssetsLibrary/AssetsLibrary.h> | 7 #import <AssetsLibrary/AssetsLibrary.h> |
8 #import <MobileCoreServices/MobileCoreServices.h> | 8 #import <MobileCoreServices/MobileCoreServices.h> |
9 #import <PassKit/PassKit.h> | 9 #import <PassKit/PassKit.h> |
10 #import <Photos/Photos.h> | 10 #import <Photos/Photos.h> |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1088 | 1088 |
1089 auto* helper = FindTabHelper::FromWebState(tab.webState); | 1089 auto* helper = FindTabHelper::FromWebState(tab.webState); |
1090 return (helper && helper->CurrentPageSupportsFindInPage() && | 1090 return (helper && helper->CurrentPageSupportsFindInPage() && |
1091 !helper->IsFindUIActive()); | 1091 !helper->IsFindUIActive()); |
1092 } | 1092 } |
1093 | 1093 |
1094 - (web::UserAgentType)userAgentType { | 1094 - (web::UserAgentType)userAgentType { |
1095 web::WebState* webState = [_model currentTab].webState; | 1095 web::WebState* webState = [_model currentTab].webState; |
1096 if (!webState) | 1096 if (!webState) |
1097 return web::UserAgentType::NONE; | 1097 return web::UserAgentType::NONE; |
1098 web::NavigationItem* visibleItem = | 1098 |
1099 webState->GetNavigationManager()->GetVisibleItem(); | 1099 web::NavigationItem* item = nullptr; |
Eugene But (OOO till 7-30)
2017/03/30 23:01:49
ditto
liaoyuke
2017/03/31 15:50:12
Done.
| |
1100 if (!visibleItem) | 1100 if (webState->GetNavigationManager()->GetTransientItem()) |
1101 item = webState->GetNavigationManager()->GetTransientItem(); | |
1102 else if (webState->GetNavigationManager()->GetPendingItem()) | |
1103 item = webState->GetNavigationManager()->GetPendingItem(); | |
1104 else if (webState->GetNavigationManager()->GetLastCommittedItem()) | |
1105 item = webState->GetNavigationManager()->GetLastCommittedItem(); | |
Eugene But (OOO till 7-30)
2017/03/30 23:01:49
Copying this logic everywhere is quite error prone
liaoyuke
2017/03/31 15:50:12
Acknowledged.
| |
1106 | |
1107 if (!item) | |
1101 return web::UserAgentType::NONE; | 1108 return web::UserAgentType::NONE; |
1102 | 1109 |
1103 return visibleItem->GetUserAgentType(); | 1110 return item->GetUserAgentType(); |
1104 } | 1111 } |
1105 | 1112 |
1106 - (void)setVisible:(BOOL)visible { | 1113 - (void)setVisible:(BOOL)visible { |
1107 if (_visible == visible) | 1114 if (_visible == visible) |
1108 return; | 1115 return; |
1109 _visible = visible; | 1116 _visible = visible; |
1110 } | 1117 } |
1111 | 1118 |
1112 - (void)setViewVisible:(BOOL)viewVisible { | 1119 - (void)setViewVisible:(BOOL)viewVisible { |
1113 if (_viewVisible == viewVisible) | 1120 if (_viewVisible == viewVisible) |
(...skipping 4012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
5126 | 5133 |
5127 - (UIView*)voiceSearchButton { | 5134 - (UIView*)voiceSearchButton { |
5128 return _voiceSearchButton; | 5135 return _voiceSearchButton; |
5129 } | 5136 } |
5130 | 5137 |
5131 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { | 5138 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { |
5132 return [self currentLogoAnimationControllerOwner]; | 5139 return [self currentLogoAnimationControllerOwner]; |
5133 } | 5140 } |
5134 | 5141 |
5135 @end | 5142 @end |
OLD | NEW |