| 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 3660 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3671 // In debug the app can continue working even after the CHECK. Adding a | 3671 // In debug the app can continue working even after the CHECK. Adding a |
| 3672 // return avoids the crash url to be added to the history. | 3672 // return avoids the crash url to be added to the history. |
| 3673 return; | 3673 return; |
| 3674 } | 3674 } |
| 3675 | 3675 |
| 3676 if (url == [_preloadController prerenderedURL]) { | 3676 if (url == [_preloadController prerenderedURL]) { |
| 3677 Tab* oldTab = [_model currentTab]; | 3677 Tab* oldTab = [_model currentTab]; |
| 3678 Tab* newTab = [_preloadController releasePrerenderContents]; | 3678 Tab* newTab = [_preloadController releasePrerenderContents]; |
| 3679 DCHECK(oldTab); | 3679 DCHECK(oldTab); |
| 3680 DCHECK(newTab); | 3680 DCHECK(newTab); |
| 3681 if (oldTab && newTab) { | 3681 BOOL canPruneItems = |
| 3682 [newTab navigationManager]->CanPruneAllButLastCommittedItem(); |
| 3683 if (oldTab && newTab && canPruneItems) { |
| 3682 [oldTab recordStateInHistory]; | 3684 [oldTab recordStateInHistory]; |
| 3683 DCHECK([newTab navigationManager]); | |
| 3684 CRWSessionController* newHistory = | 3685 CRWSessionController* newHistory = |
| 3685 [newTab navigationManagerImpl]->GetSessionController(); | 3686 [newTab navigationManagerImpl]->GetSessionController(); |
| 3686 DCHECK([oldTab navigationManager]); | |
| 3687 CRWSessionController* oldHistory = | 3687 CRWSessionController* oldHistory = |
| 3688 [oldTab navigationManagerImpl]->GetSessionController(); | 3688 [oldTab navigationManagerImpl]->GetSessionController(); |
| 3689 [newHistory insertStateFromSessionController:oldHistory]; | 3689 [newHistory copyStateFromSessionControllerAndPrune:oldHistory]; |
| 3690 [[newTab nativeAppNavigationController] | 3690 [[newTab nativeAppNavigationController] |
| 3691 copyStateFrom:[oldTab nativeAppNavigationController]]; | 3691 copyStateFrom:[oldTab nativeAppNavigationController]]; |
| 3692 [_model replaceTab:oldTab withTab:newTab]; | 3692 [_model replaceTab:oldTab withTab:newTab]; |
| 3693 | 3693 |
| 3694 // Set isPrerenderTab to NO after replacing the tab. This will allow the | 3694 // Set isPrerenderTab to NO after replacing the tab. This will allow the |
| 3695 // BrowserViewController to detect that a pre-rendered tab is switched in, | 3695 // BrowserViewController to detect that a pre-rendered tab is switched in, |
| 3696 // and show the prerendering animation. | 3696 // and show the prerendering animation. |
| 3697 newTab.isPrerenderTab = NO; | 3697 newTab.isPrerenderTab = NO; |
| 3698 | 3698 |
| 3699 [self tabLoadComplete:newTab withSuccess:newTab.loadFinished]; | 3699 [self tabLoadComplete:newTab withSuccess:newTab.loadFinished]; |
| (...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5129 | 5129 |
| 5130 - (UIView*)voiceSearchButton { | 5130 - (UIView*)voiceSearchButton { |
| 5131 return _voiceSearchButton; | 5131 return _voiceSearchButton; |
| 5132 } | 5132 } |
| 5133 | 5133 |
| 5134 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { | 5134 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { |
| 5135 return [self currentLogoAnimationControllerOwner]; | 5135 return [self currentLogoAnimationControllerOwner]; |
| 5136 } | 5136 } |
| 5137 | 5137 |
| 5138 @end | 5138 @end |
| OLD | NEW |