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..15d031f30be9806b3dc59b829fa242c45717ac9e 100644 |
| --- a/chrome/browser/captive_portal/captive_portal_tab_helper.cc |
| +++ b/chrome/browser/captive_portal/captive_portal_tab_helper.cc |
| @@ -62,8 +62,7 @@ void CaptivePortalTabHelper::DidStartNavigation( |
| // and it committed (either the navigation proper or an error page), it is |
| // safe to start tracking the new navigation. Otherwise simulate an abort |
| // before reporting the start of the new navigation. |
| - if (navigation_handle_ && !navigation_handle_->HasCommittedDocument() && |
| - !navigation_handle_->HasCommittedErrorPage()) { |
| + if (navigation_handle_ && !navigation_handle_->HasCommitted()) { |
| tab_reloader_->OnAbort(); |
| } |
| @@ -82,35 +81,30 @@ 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) |
| + if (navigation_handle_ != navigation_handle) { |
| + if (!navigation_handle->HasCommitted()) |
|
mmenke
2015/09/21 20:28:24
Why the change in behavior here? Worth a comment?
clamy
2015/09/22 00:38:05
Done.
|
| + return; |
| DidStartNavigation(navigation_handle); |
| - |
| - 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(); |
| } |
| - login_detector_->OnStoppedLoading(); |
| + if (navigation_handle->HasCommitted()) |
| + tab_reloader_->OnLoadCommitted(navigation_handle->GetNetErrorCode()); |
| + else |
| + tab_reloader_->OnAbort(); |
|
mmenke
2015/09/21 20:28:24
nit: Use braces with else if (Style here varies b
clamy
2015/09/22 00:38:05
Done.
|
| navigation_handle_ = nullptr; |
| } |
| +void CaptivePortalTabHelper::DidStopLoading() { |
|
mmenke
2015/09/21 20:28:24
Why the change here?
clamy
2015/09/22 00:38:05
We changed the moment DidFinishNavigation will be
|
| + login_detector_->OnStoppedLoading(); |
| +} |
| + |
| void CaptivePortalTabHelper::Observe( |
| int type, |
| const content::NotificationSource& source, |