Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(594)

Side by Side Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2703333006: Move the notion of current Tab from TabModel to WebStateList. (Closed)
Patch Set: Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3563 matching lines...) Expand 10 before | Expand all | Expand 10 after
3574 [newHistory insertStateFromSessionController:oldHistory]; 3574 [newHistory insertStateFromSessionController:oldHistory];
3575 [[newTab nativeAppNavigationController] 3575 [[newTab nativeAppNavigationController]
3576 copyStateFrom:[oldTab nativeAppNavigationController]]; 3576 copyStateFrom:[oldTab nativeAppNavigationController]];
3577 [_model replaceTab:oldTab withTab:newTab]; 3577 [_model replaceTab:oldTab withTab:newTab];
3578 3578
3579 // Set isPrerenderTab to NO after replacing the tab. This will allow the 3579 // Set isPrerenderTab to NO after replacing the tab. This will allow the
3580 // BrowserViewController to detect that a pre-rendered tab is switched in, 3580 // BrowserViewController to detect that a pre-rendered tab is switched in,
3581 // and show the prerendering animation. 3581 // and show the prerendering animation.
3582 newTab.isPrerenderTab = NO; 3582 newTab.isPrerenderTab = NO;
3583 3583
3584 BOOL loadingFinished = 3584 [self tabLoadComplete:newTab withSuccess:newTab.loadFinished];
3585 [newTab.webController loadPhase] == web::PAGE_LOADED;
3586 [self tabLoadComplete:newTab withSuccess:loadingFinished];
3587 3585
3588 return; 3586 return;
3589 } 3587 }
3590 } 3588 }
3591 3589
3592 GURL urlToLoad = url; 3590 GURL urlToLoad = url;
3593 if ([_preloadController hasPrefetchedURL:url]) { 3591 if ([_preloadController hasPrefetchedURL:url]) {
3594 // Prefetched URLs have modified URLs, so load the prefetched version of 3592 // Prefetched URLs have modified URLs, so load the prefetched version of
3595 // |url| instead of the original |url|. 3593 // |url| instead of the original |url|.
3596 urlToLoad = [_preloadController prefetchedURL]; 3594 urlToLoad = [_preloadController prefetchedURL];
(...skipping 950 matching lines...) Expand 10 before | Expand all | Expand 10 after
4547 4545
4548 // Set isPrerenderTab to NO after inserting the tab. This will allow the 4546 // Set isPrerenderTab to NO after inserting the tab. This will allow the
4549 // BrowserViewController to detect that a pre-rendered tab is switched in, 4547 // BrowserViewController to detect that a pre-rendered tab is switched in,
4550 // and show the prerendering animation. This needs to happen before the 4548 // and show the prerendering animation. This needs to happen before the
4551 // tab is made the current tab. 4549 // tab is made the current tab.
4552 // This also enables contextual search (if otherwise applicable) on 4550 // This also enables contextual search (if otherwise applicable) on
4553 // |newTab|. 4551 // |newTab|.
4554 newTab.isPrerenderTab = NO; 4552 newTab.isPrerenderTab = NO;
4555 [_model setCurrentTab:newTab]; 4553 [_model setCurrentTab:newTab];
4556 4554
4557 BOOL loadingFinished = [newTab.webController loadPhase] == web::PAGE_LOADED; 4555 if (newTab.loadFinished)
4558 if (loadingFinished)
4559 [self tabLoadComplete:newTab withSuccess:YES]; 4556 [self tabLoadComplete:newTab withSuccess:YES];
4560 4557
4561 if (focusInput) { 4558 if (focusInput) {
4562 [_toolbarController focusOmnibox]; 4559 [_toolbarController focusOmnibox];
4563 } 4560 }
4564 _infoBarContainer->RestoreInfobars(); 4561 _infoBarContainer->RestoreInfobars();
4565 4562
4566 [UIView animateWithDuration:ios::material::kDuration2 4563 [UIView animateWithDuration:ios::material::kDuration2
4567 animations:^{ 4564 animations:^{
4568 promotingPanel.alpha = 0; 4565 promotingPanel.alpha = 0;
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
4998 4995
4999 - (UIView*)voiceSearchButton { 4996 - (UIView*)voiceSearchButton {
5000 return _voiceSearchButton; 4997 return _voiceSearchButton;
5001 } 4998 }
5002 4999
5003 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner { 5000 - (id<LogoAnimationControllerOwner>)logoAnimationControllerOwner {
5004 return [self currentLogoAnimationControllerOwner]; 5001 return [self currentLogoAnimationControllerOwner];
5005 } 5002 }
5006 5003
5007 @end 5004 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698