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

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

Issue 2780403003: Removed -[CRWWebDelegate webWillInitiateLoadWithParams:]. (Closed)
Patch Set: Fixed tests Created 3 years, 8 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 1044 matching lines...) Expand 10 before | Expand all | Expand 10 after
1055 history::HistoryService* historyService = 1055 history::HistoryService* historyService =
1056 ios::HistoryServiceFactory::GetForBrowserState( 1056 ios::HistoryServiceFactory::GetForBrowserState(
1057 browserState_, ServiceAccessType::IMPLICIT_ACCESS); 1057 browserState_, ServiceAccessType::IMPLICIT_ACCESS);
1058 DCHECK(historyService); 1058 DCHECK(historyService);
1059 1059
1060 for (size_t i = 0; i < addPageVector_.size(); ++i) 1060 for (size_t i = 0; i < addPageVector_.size(); ++i)
1061 historyService->AddPage(addPageVector_[i]); 1061 historyService->AddPage(addPageVector_[i]);
1062 addPageVector_.clear(); 1062 addPageVector_.clear();
1063 } 1063 }
1064 1064
1065 - (void)webWillInitiateLoadWithParams: 1065 - (void)webDidUpdateSessionForLoadWithParams:
1066 (web::NavigationManager::WebLoadParams&)params { 1066 (const web::NavigationManager::WebLoadParams&)params
1067 wasInitialNavigation:(BOOL)initialNavigation {
1068 // After a crash the NTP is loaded by default.
1067 GURL navUrl = params.url; 1069 GURL navUrl = params.url;
1068
1069 // After a crash the NTP is loaded by default.
1070 if (navUrl.host() != kChromeUINewTabHost) { 1070 if (navUrl.host() != kChromeUINewTabHost) {
justincohen 2017/04/04 16:45:24 Do we still need to extract params.url into navUrl
Eugene But (OOO till 7-30) 2017/04/04 16:58:15 No. Done.
1071 static BOOL hasLoadedPage = NO; 1071 static BOOL hasLoadedPage = NO;
1072 if (!hasLoadedPage) { 1072 if (!hasLoadedPage) {
1073 // As soon as an URL is loaded, a crash shouldn't be counted as a startup 1073 // As soon as an URL is loaded, a crash shouldn't be counted as a startup
Eugene But (OOO till 7-30) 2017/04/04 16:58:15 Actually this comment is not correct and was not c
justincohen 2017/04/04 17:08:13 I think the meaning behind 'load' means initiate l
1074 // crash. Since loading an url requires user action and is a significant 1074 // crash. Since loading an url requires user action and is a significant
1075 // source of crashes that could lead to false positives in crash loop 1075 // source of crashes that could lead to false positives in crash loop
1076 // detection. 1076 // detection.
1077 crash_util::ResetFailedStartupAttemptCount(); 1077 crash_util::ResetFailedStartupAttemptCount();
1078 hasLoadedPage = YES; 1078 hasLoadedPage = YES;
1079 } 1079 }
1080 } 1080 }
1081 }
1082 1081
1083 - (void)webDidUpdateSessionForLoadWithParams:
1084 (const web::NavigationManager::WebLoadParams&)params
1085 wasInitialNavigation:(BOOL)initialNavigation {
1086 GURL navUrl = params.url;
1087 ui::PageTransition transition = params.transition_type; 1082 ui::PageTransition transition = params.transition_type;
1088 1083
1089 // Record any explicit, non-redirect navigation as a clobber (as long as it's 1084 // Record any explicit, non-redirect navigation as a clobber (as long as it's
1090 // in a real tab). 1085 // in a real tab).
1091 if (!initialNavigation && !isPrerenderTab_ && 1086 if (!initialNavigation && !isPrerenderTab_ &&
1092 !PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_RELOAD) && 1087 !PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_RELOAD) &&
1093 (transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK) == 0) { 1088 (transition & ui::PAGE_TRANSITION_IS_REDIRECT_MASK) == 0) {
1094 base::RecordAction(UserMetricsAction("MobileTabClobbered")); 1089 base::RecordAction(UserMetricsAction("MobileTabClobbered"));
1095 } 1090 }
1096 if ([parentTabModel_ tabUsageRecorder]) 1091 if ([parentTabModel_ tabUsageRecorder])
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after
2095 2090
2096 - (TabModel*)parentTabModel { 2091 - (TabModel*)parentTabModel {
2097 return parentTabModel_; 2092 return parentTabModel_;
2098 } 2093 }
2099 2094
2100 - (FormInputAccessoryViewController*)inputAccessoryViewController { 2095 - (FormInputAccessoryViewController*)inputAccessoryViewController {
2101 return inputAccessoryViewController_.get(); 2096 return inputAccessoryViewController_.get();
2102 } 2097 }
2103 2098
2104 @end 2099 @end
OLDNEW
« no previous file with comments | « no previous file | ios/web/public/web_state/ui/crw_web_delegate.h » ('j') | ios/web/web_state/ui/crw_web_controller.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698