| 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 3588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3599 [newHistory insertStateFromSessionController:oldHistory]; | 3599 [newHistory insertStateFromSessionController:oldHistory]; |
| 3600 [[newTab nativeAppNavigationController] | 3600 [[newTab nativeAppNavigationController] |
| 3601 copyStateFrom:[oldTab nativeAppNavigationController]]; | 3601 copyStateFrom:[oldTab nativeAppNavigationController]]; |
| 3602 [_model replaceTab:oldTab withTab:newTab]; | 3602 [_model replaceTab:oldTab withTab:newTab]; |
| 3603 | 3603 |
| 3604 // Set isPrerenderTab to NO after replacing the tab. This will allow the | 3604 // Set isPrerenderTab to NO after replacing the tab. This will allow the |
| 3605 // BrowserViewController to detect that a pre-rendered tab is switched in, | 3605 // BrowserViewController to detect that a pre-rendered tab is switched in, |
| 3606 // and show the prerendering animation. | 3606 // and show the prerendering animation. |
| 3607 newTab.isPrerenderTab = NO; | 3607 newTab.isPrerenderTab = NO; |
| 3608 | 3608 |
| 3609 BOOL loadingFinished = | 3609 [self tabLoadComplete:newTab withSuccess:newTab.loadFinished]; |
| 3610 [newTab.webController loadPhase] == web::PAGE_LOADED; | |
| 3611 [self tabLoadComplete:newTab withSuccess:loadingFinished]; | |
| 3612 | 3610 |
| 3613 return; | 3611 return; |
| 3614 } | 3612 } |
| 3615 } | 3613 } |
| 3616 | 3614 |
| 3617 GURL urlToLoad = url; | 3615 GURL urlToLoad = url; |
| 3618 if ([_preloadController hasPrefetchedURL:url]) { | 3616 if ([_preloadController hasPrefetchedURL:url]) { |
| 3619 // Prefetched URLs have modified URLs, so load the prefetched version of | 3617 // Prefetched URLs have modified URLs, so load the prefetched version of |
| 3620 // |url| instead of the original |url|. | 3618 // |url| instead of the original |url|. |
| 3621 urlToLoad = [_preloadController prefetchedURL]; | 3619 urlToLoad = [_preloadController prefetchedURL]; |
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4574 | 4572 |
| 4575 // Set isPrerenderTab to NO after inserting the tab. This will allow the | 4573 // Set isPrerenderTab to NO after inserting the tab. This will allow the |
| 4576 // BrowserViewController to detect that a pre-rendered tab is switched in, | 4574 // BrowserViewController to detect that a pre-rendered tab is switched in, |
| 4577 // and show the prerendering animation. This needs to happen before the | 4575 // and show the prerendering animation. This needs to happen before the |
| 4578 // tab is made the current tab. | 4576 // tab is made the current tab. |
| 4579 // This also enables contextual search (if otherwise applicable) on | 4577 // This also enables contextual search (if otherwise applicable) on |
| 4580 // |newTab|. | 4578 // |newTab|. |
| 4581 newTab.isPrerenderTab = NO; | 4579 newTab.isPrerenderTab = NO; |
| 4582 [_model setCurrentTab:newTab]; | 4580 [_model setCurrentTab:newTab]; |
| 4583 | 4581 |
| 4584 BOOL loadingFinished = [newTab.webController loadPhase] == web::PAGE_LOADED; | 4582 if (newTab.loadFinished) |
| 4585 if (loadingFinished) | |
| 4586 [self tabLoadComplete:newTab withSuccess:YES]; | 4583 [self tabLoadComplete:newTab withSuccess:YES]; |
| 4587 | 4584 |
| 4588 if (focusInput) { | 4585 if (focusInput) { |
| 4589 [_toolbarController focusOmnibox]; | 4586 [_toolbarController focusOmnibox]; |
| 4590 } | 4587 } |
| 4591 _infoBarContainer->RestoreInfobars(); | 4588 _infoBarContainer->RestoreInfobars(); |
| 4592 | 4589 |
| 4593 [UIView animateWithDuration:ios::material::kDuration2 | 4590 [UIView animateWithDuration:ios::material::kDuration2 |
| 4594 animations:^{ | 4591 animations:^{ |
| 4595 promotingPanel.alpha = 0; | 4592 promotingPanel.alpha = 0; |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5025 | 5022 |
| 5026 - (UIView*)voiceSearchButton { | 5023 - (UIView*)voiceSearchButton { |
| 5027 return _voiceSearchButton; | 5024 return _voiceSearchButton; |
| 5028 } | 5025 } |
| 5029 | 5026 |
| 5030 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { | 5027 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { |
| 5031 return [self currentLogoAnimationControllerOwner]; | 5028 return [self currentLogoAnimationControllerOwner]; |
| 5032 } | 5029 } |
| 5033 | 5030 |
| 5034 @end | 5031 @end |
| OLD | NEW |