| 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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 // finished. | 464 // finished. |
| 465 BOOL _startVoiceSearchAfterNewTabAnimation; | 465 BOOL _startVoiceSearchAfterNewTabAnimation; |
| 466 | 466 |
| 467 // YES if the user interacts with the location bar. | 467 // YES if the user interacts with the location bar. |
| 468 BOOL _locationBarHasFocus; | 468 BOOL _locationBarHasFocus; |
| 469 // YES if a load was cancelled due to typing in the location bar. | 469 // YES if a load was cancelled due to typing in the location bar. |
| 470 BOOL _locationBarEditCancelledLoad; | 470 BOOL _locationBarEditCancelledLoad; |
| 471 // YES if waiting for a foreground tab due to expectNewForegroundTab. | 471 // YES if waiting for a foreground tab due to expectNewForegroundTab. |
| 472 BOOL _expectingForegroundTab; | 472 BOOL _expectingForegroundTab; |
| 473 | 473 |
| 474 // Whether or not -shutdown has been called. | |
| 475 BOOL _isShutdown; | |
| 476 | |
| 477 // The ChromeBrowserState associated with this BVC. | 474 // The ChromeBrowserState associated with this BVC. |
| 478 ios::ChromeBrowserState* _browserState; // weak | 475 ios::ChromeBrowserState* _browserState; // weak |
| 479 | 476 |
| 480 // Whether or not Incognito* is enabled. | 477 // Whether or not Incognito* is enabled. |
| 481 BOOL _isOffTheRecord; | 478 BOOL _isOffTheRecord; |
| 482 | 479 |
| 483 // The last point within |_contentArea| that's received a touch. | 480 // The last point within |_contentArea| that's received a touch. |
| 484 CGPoint _lastTapPoint; | 481 CGPoint _lastTapPoint; |
| 485 | 482 |
| 486 // The time at which |_lastTapPoint| was most recently set. | 483 // The time at which |_lastTapPoint| was most recently set. |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 985 NOTREACHED(); | 982 NOTREACHED(); |
| 986 return nil; | 983 return nil; |
| 987 } | 984 } |
| 988 | 985 |
| 989 - (instancetype)initWithCoder:(NSCoder*)aDecoder { | 986 - (instancetype)initWithCoder:(NSCoder*)aDecoder { |
| 990 NOTREACHED(); | 987 NOTREACHED(); |
| 991 return nil; | 988 return nil; |
| 992 } | 989 } |
| 993 | 990 |
| 994 - (void)dealloc { | 991 - (void)dealloc { |
| 995 DCHECK(_isShutdown) << "-shutdown must be called before dealloc."; | 992 _tabStripController = nil; |
| 993 _infoBarContainer = nil; |
| 994 _readingListMenuNotifier = nil; |
| 995 if (_bookmarkModel) |
| 996 _bookmarkModel->RemoveObserver(_bookmarkModelBridge.get()); |
| 997 [_model removeObserver:self]; |
| 998 [[UpgradeCenter sharedInstance] unregisterClient:self]; |
| 999 [[NSNotificationCenter defaultCenter] removeObserver:self]; |
| 1000 [_toolbarController setDelegate:nil]; |
| 1001 if (_voiceSearchController) |
| 1002 _voiceSearchController->SetDelegate(nil); |
| 1003 [_rateThisAppDialog setDelegate:nil]; |
| 1004 [_model closeAllTabs]; |
| 996 } | 1005 } |
| 997 | 1006 |
| 998 #pragma mark - Accessibility | 1007 #pragma mark - Accessibility |
| 999 | 1008 |
| 1000 - (BOOL)accessibilityPerformEscape { | 1009 - (BOOL)accessibilityPerformEscape { |
| 1001 [self dismissPopups]; | 1010 [self dismissPopups]; |
| 1002 return YES; | 1011 return YES; |
| 1003 } | 1012 } |
| 1004 | 1013 |
| 1005 #pragma mark - Properties | 1014 #pragma mark - Properties |
| (...skipping 1245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2251 // Delay the cleanup of the unreferenced files received from other apps | 2260 // Delay the cleanup of the unreferenced files received from other apps |
| 2252 // to not impact startup performance. | 2261 // to not impact startup performance. |
| 2253 int delay = immediately ? 0 : kExternalFilesCleanupDelaySeconds; | 2262 int delay = immediately ? 0 : kExternalFilesCleanupDelaySeconds; |
| 2254 _externalFileRemover->RemoveAfterDelay( | 2263 _externalFileRemover->RemoveAfterDelay( |
| 2255 base::TimeDelta::FromSeconds(delay), | 2264 base::TimeDelta::FromSeconds(delay), |
| 2256 base::BindBlockArc(completionHandler ? completionHandler | 2265 base::BindBlockArc(completionHandler ? completionHandler |
| 2257 : ^{ | 2266 : ^{ |
| 2258 })); | 2267 })); |
| 2259 } | 2268 } |
| 2260 | 2269 |
| 2261 - (void)shutdown { | |
| 2262 DCHECK(!_isShutdown); | |
| 2263 _isShutdown = YES; | |
| 2264 | |
| 2265 _tabStripController = nil; | |
| 2266 _infoBarContainer = nil; | |
| 2267 _readingListMenuNotifier = nil; | |
| 2268 if (_bookmarkModel) | |
| 2269 _bookmarkModel->RemoveObserver(_bookmarkModelBridge.get()); | |
| 2270 [_model removeObserver:self]; | |
| 2271 [[UpgradeCenter sharedInstance] unregisterClient:self]; | |
| 2272 [[NSNotificationCenter defaultCenter] removeObserver:self]; | |
| 2273 [_toolbarController setDelegate:nil]; | |
| 2274 if (_voiceSearchController) | |
| 2275 _voiceSearchController->SetDelegate(nil); | |
| 2276 [_rateThisAppDialog setDelegate:nil]; | |
| 2277 [_model closeAllTabs]; | |
| 2278 } | |
| 2279 | |
| 2280 #pragma mark - SnapshotOverlayProvider methods | 2270 #pragma mark - SnapshotOverlayProvider methods |
| 2281 | 2271 |
| 2282 - (NSArray*)snapshotOverlaysForTab:(Tab*)tab { | 2272 - (NSArray*)snapshotOverlaysForTab:(Tab*)tab { |
| 2283 NSMutableArray* overlays = [NSMutableArray array]; | 2273 NSMutableArray* overlays = [NSMutableArray array]; |
| 2284 if (![_model webUsageEnabled]) { | 2274 if (![_model webUsageEnabled]) { |
| 2285 return overlays; | 2275 return overlays; |
| 2286 } | 2276 } |
| 2287 UIView* voiceSearchView = [self voiceSearchOverlayViewForTab:tab]; | 2277 UIView* voiceSearchView = [self voiceSearchOverlayViewForTab:tab]; |
| 2288 if (voiceSearchView) { | 2278 if (voiceSearchView) { |
| 2289 CGFloat voiceSearchYOffset = [self voiceSearchOverlayYOffsetForTab:tab]; | 2279 CGFloat voiceSearchYOffset = [self voiceSearchOverlayYOffsetForTab:tab]; |
| (...skipping 2946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5236 | 5226 |
| 5237 - (UIView*)voiceSearchButton { | 5227 - (UIView*)voiceSearchButton { |
| 5238 return _voiceSearchButton; | 5228 return _voiceSearchButton; |
| 5239 } | 5229 } |
| 5240 | 5230 |
| 5241 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { | 5231 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { |
| 5242 return [self currentLogoAnimationControllerOwner]; | 5232 return [self currentLogoAnimationControllerOwner]; |
| 5243 } | 5233 } |
| 5244 | 5234 |
| 5245 @end | 5235 @end |
| OLD | NEW |