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

Side by Side Diff: chrome/browser/captive_portal/captive_portal_tab_helper.cc

Issue 1194383003: Add a flag showing whether the current request was ignored by a handler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix trybot failures (DidFailProvisionalLoad calls in unit tests) Created 5 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h" 5 #include "chrome/browser/captive_portal/captive_portal_tab_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/captive_portal/captive_portal_login_detector.h" 8 #include "chrome/browser/captive_portal/captive_portal_login_detector.h"
9 #include "chrome/browser/captive_portal/captive_portal_service_factory.h" 9 #include "chrome/browser/captive_portal/captive_portal_service_factory.h"
10 #include "chrome/browser/captive_portal/captive_portal_tab_reloader.h" 10 #include "chrome/browser/captive_portal/captive_portal_tab_reloader.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 } 120 }
121 121
122 provisional_render_view_host_ = NULL; 122 provisional_render_view_host_ = NULL;
123 pending_error_code_ = net::OK; 123 pending_error_code_ = net::OK;
124 } 124 }
125 125
126 void CaptivePortalTabHelper::DidFailProvisionalLoad( 126 void CaptivePortalTabHelper::DidFailProvisionalLoad(
127 content::RenderFrameHost* render_frame_host, 127 content::RenderFrameHost* render_frame_host,
128 const GURL& validated_url, 128 const GURL& validated_url,
129 int error_code, 129 int error_code,
130 const base::string16& error_description) { 130 const base::string16& error_description,
131 bool was_ignored_by_handler) {
131 DCHECK(CalledOnValidThread()); 132 DCHECK(CalledOnValidThread());
132 133
133 // Ignore subframes and unexpected RenderViewHosts. 134 // Ignore subframes and unexpected RenderViewHosts.
134 if (render_frame_host->GetParent() || 135 if (render_frame_host->GetParent() ||
135 render_frame_host->GetRenderViewHost() != provisional_render_view_host_) 136 render_frame_host->GetRenderViewHost() != provisional_render_view_host_)
136 return; 137 return;
137 138
138 // Aborts generally aren't followed by loading an error page, so go ahead and 139 // Aborts generally aren't followed by loading an error page, so go ahead and
139 // reset the state now, to prevent any captive portal checks from triggering. 140 // reset the state now, to prevent any captive portal checks from triggering.
140 if (error_code == net::ERR_ABORTED) { 141 if (error_code == net::ERR_ABORTED) {
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 } 264 }
264 265
265 void CaptivePortalTabHelper::SetTabReloaderForTest( 266 void CaptivePortalTabHelper::SetTabReloaderForTest(
266 CaptivePortalTabReloader* tab_reloader) { 267 CaptivePortalTabReloader* tab_reloader) {
267 tab_reloader_.reset(tab_reloader); 268 tab_reloader_.reset(tab_reloader);
268 } 269 }
269 270
270 CaptivePortalTabReloader* CaptivePortalTabHelper::GetTabReloaderForTest() { 271 CaptivePortalTabReloader* CaptivePortalTabHelper::GetTabReloaderForTest() {
271 return tab_reloader_.get(); 272 return tab_reloader_.get();
272 } 273 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698