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

Unified Diff: chrome/browser/captive_portal/captive_portal_tab_helper.cc

Issue 1350673003: Remove WebContentsObserver::DidCommitNavigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/captive_portal/captive_portal_tab_helper.cc
diff --git a/chrome/browser/captive_portal/captive_portal_tab_helper.cc b/chrome/browser/captive_portal/captive_portal_tab_helper.cc
index 1e76e41359d1edb19097117f92e7cad68d043409..679f1c50c0572bd2d8ffc43ffc17e6672304aaf5 100644
--- a/chrome/browser/captive_portal/captive_portal_tab_helper.cc
+++ b/chrome/browser/captive_portal/captive_portal_tab_helper.cc
@@ -82,35 +82,33 @@ void CaptivePortalTabHelper::DidRedirectNavigation(
navigation_handle->GetURL().SchemeIsCryptographic());
}
-void CaptivePortalTabHelper::DidCommitNavigation(
+void CaptivePortalTabHelper::DidFinishNavigation(
content::NavigationHandle* navigation_handle) {
DCHECK(CalledOnValidThread());
if (!navigation_handle->IsInMainFrame())
return;
- if (navigation_handle_ != navigation_handle)
- DidStartNavigation(navigation_handle);
+ bool navigation_has_committed = navigation_handle->HasCommittedDocument() ||
+ navigation_handle->HasCommittedErrorPage();
Charlie Reis 2015/09/18 17:05:20 Seems like lots of places will have to use this pa
clamy 2015/09/18 20:37:33 Done.
- tab_reloader_->OnLoadCommitted(navigation_handle->GetNetErrorCode());
-}
-
-void CaptivePortalTabHelper::DidFinishNavigation(
- content::NavigationHandle* navigation_handle) {
- DCHECK(CalledOnValidThread());
- if (navigation_handle != navigation_handle_)
- return;
- DCHECK(navigation_handle->IsInMainFrame());
-
- if (!navigation_handle->HasCommittedDocument() &&
- !navigation_handle->HasCommittedErrorPage()) {
- tab_reloader_->OnAbort();
+ if (navigation_handle_ != navigation_handle) {
+ if (!navigation_has_committed)
+ return;
+ DidStartNavigation(navigation_handle);
}
- login_detector_->OnStoppedLoading();
+ if (navigation_has_committed)
+ tab_reloader_->OnLoadCommitted(navigation_handle->GetNetErrorCode());
+ else
+ tab_reloader_->OnAbort();
navigation_handle_ = nullptr;
}
+void CaptivePortalTabHelper::DidStopLoading() {
+ login_detector_->OnStoppedLoading();
+}
+
void CaptivePortalTabHelper::Observe(
int type,
const content::NotificationSource& source,

Powered by Google App Engine
This is Rietveld 408576698