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

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

Issue 242483003: Move CaptivePortalDetector to src/components/captive_portal (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move CaptivePortalDetector to a component Created 6 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 | Annotate | Revision Log
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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 // Only main frame redirects for the provisional RenderViewHost matter. 203 // Only main frame redirects for the provisional RenderViewHost matter.
204 if (resource_type != ResourceType::MAIN_FRAME || 204 if (resource_type != ResourceType::MAIN_FRAME ||
205 !provisional_render_view_host_ || 205 !provisional_render_view_host_ ||
206 provisional_render_view_host_->GetProcess()->GetID() != child_id) { 206 provisional_render_view_host_->GetProcess()->GetID() != child_id) {
207 return; 207 return;
208 } 208 }
209 209
210 tab_reloader_->OnRedirect(new_url.SchemeIsSecure()); 210 tab_reloader_->OnRedirect(new_url.SchemeIsSecure());
211 } 211 }
212 212
213 void CaptivePortalTabHelper::OnCaptivePortalResults(Result previous_result, 213 void CaptivePortalTabHelper::OnCaptivePortalResults(
214 Result result) { 214 CaptivePortalResult previous_result,
215 CaptivePortalResult result) {
215 tab_reloader_->OnCaptivePortalResults(previous_result, result); 216 tab_reloader_->OnCaptivePortalResults(previous_result, result);
216 login_detector_->OnCaptivePortalResults(previous_result, result); 217 login_detector_->OnCaptivePortalResults(previous_result, result);
217 } 218 }
218 219
219 void CaptivePortalTabHelper::OnLoadAborted() { 220 void CaptivePortalTabHelper::OnLoadAborted() {
220 // No further messages for the cancelled navigation will occur. 221 // No further messages for the cancelled navigation will occur.
221 provisional_render_view_host_ = NULL; 222 provisional_render_view_host_ = NULL;
222 // May have been aborting the load of an error page. 223 // May have been aborting the load of an error page.
223 pending_error_code_ = net::OK; 224 pending_error_code_ = net::OK;
224 225
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 content::WebContents* web_contents = chrome::AddSelectedTabWithURL( 264 content::WebContents* web_contents = chrome::AddSelectedTabWithURL(
264 browser, 265 browser,
265 CaptivePortalServiceFactory::GetForProfile(profile_)->test_url(), 266 CaptivePortalServiceFactory::GetForProfile(profile_)->test_url(),
266 content::PAGE_TRANSITION_TYPED); 267 content::PAGE_TRANSITION_TYPED);
267 captive_portal::CaptivePortalTabHelper* captive_portal_tab_helper = 268 captive_portal::CaptivePortalTabHelper* captive_portal_tab_helper =
268 captive_portal::CaptivePortalTabHelper::FromWebContents(web_contents); 269 captive_portal::CaptivePortalTabHelper::FromWebContents(web_contents);
269 captive_portal_tab_helper->SetIsLoginTab(); 270 captive_portal_tab_helper->SetIsLoginTab();
270 } 271 }
271 272
272 } // namespace captive_portal 273 } // namespace captive_portal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698