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

Side by Side Diff: ios/chrome/browser/tabs/tab.mm

Issue 2931833004: Always set the navigation pending item for page reload. (Closed)
Patch Set: only reload cases Created 3 years, 6 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/tabs/tab.h" 5 #import "ios/chrome/browser/tabs/tab.h"
6 6
7 #import <CoreLocation/CoreLocation.h> 7 #import <CoreLocation/CoreLocation.h>
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after
960 base::RecordAction(base::UserMetricsAction("MobileTabClobbered")); 960 base::RecordAction(base::UserMetricsAction("MobileTabClobbered"));
961 } 961 }
962 if ([_parentTabModel tabUsageRecorder]) 962 if ([_parentTabModel tabUsageRecorder])
963 [_parentTabModel tabUsageRecorder]->RecordPageLoadStart(self); 963 [_parentTabModel tabUsageRecorder]->RecordPageLoadStart(self);
964 964
965 // Reset |isVoiceSearchResultsTab| since a new page is being navigated to. 965 // Reset |isVoiceSearchResultsTab| since a new page is being navigated to.
966 self.isVoiceSearchResultsTab = NO; 966 self.isVoiceSearchResultsTab = NO;
967 967
968 web::NavigationItem* navigationItem = 968 web::NavigationItem* navigationItem =
969 [self navigationManager]->GetPendingItem(); 969 [self navigationManager]->GetPendingItem();
970 970 DCHECK(navigationItem);
971 // TODO(crbug.com/676129): the pending item is not correctly set when the
972 // page is reloading, use the last committed item if pending item is null.
973 // Remove this once tracking bug is fixed.
974 if (!navigationItem)
975 navigationItem = [self navigationManager]->GetLastCommittedItem();
976
977 [[OmniboxGeolocationController sharedInstance] 971 [[OmniboxGeolocationController sharedInstance]
978 addLocationToNavigationItem:navigationItem 972 addLocationToNavigationItem:navigationItem
979 browserState:_browserState]; 973 browserState:_browserState];
980 } 974 }
981 975
982 - (void)loadSessionTab:(const sessions::SessionTab*)sessionTab { 976 - (void)loadSessionTab:(const sessions::SessionTab*)sessionTab {
983 DCHECK(sessionTab); 977 DCHECK(sessionTab);
984 [self replaceHistoryWithNavigations:sessionTab->navigations 978 [self replaceHistoryWithNavigations:sessionTab->navigations
985 currentIndex:sessionTab->current_navigation_index]; 979 currentIndex:sessionTab->current_navigation_index];
986 } 980 }
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
1902 1896
1903 - (TabModel*)parentTabModel { 1897 - (TabModel*)parentTabModel {
1904 return _parentTabModel; 1898 return _parentTabModel;
1905 } 1899 }
1906 1900
1907 - (FormInputAccessoryViewController*)inputAccessoryViewController { 1901 - (FormInputAccessoryViewController*)inputAccessoryViewController {
1908 return _inputAccessoryViewController; 1902 return _inputAccessoryViewController;
1909 } 1903 }
1910 1904
1911 @end 1905 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698