Chromium Code Reviews| 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, |