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

Side by Side Diff: chrome/browser/captive_portal/captive_portal_tab_reloader.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_reloader.h" 5 #include "chrome/browser/captive_portal/captive_portal_tab_reloader.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "chrome/browser/captive_portal/captive_portal_service.h" 10 #include "chrome/browser/captive_portal/captive_portal_service.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 return; 120 return;
121 // Only start the SSL timer running if no SSL URL has been seen in the current 121 // Only start the SSL timer running if no SSL URL has been seen in the current
122 // redirect chain. If we've already successfully downloaded one SSL URL, 122 // redirect chain. If we've already successfully downloaded one SSL URL,
123 // assume we're not behind a captive portal. 123 // assume we're not behind a captive portal.
124 if (!ssl_url_in_redirect_chain_) 124 if (!ssl_url_in_redirect_chain_)
125 SetState(STATE_TIMER_RUNNING); 125 SetState(STATE_TIMER_RUNNING);
126 ssl_url_in_redirect_chain_ = true; 126 ssl_url_in_redirect_chain_ = true;
127 } 127 }
128 128
129 void CaptivePortalTabReloader::OnCaptivePortalResults( 129 void CaptivePortalTabReloader::OnCaptivePortalResults(
130 Result previous_result, 130 CaptivePortalResult previous_result,
131 Result result) { 131 CaptivePortalResult result) {
132 if (result == RESULT_BEHIND_CAPTIVE_PORTAL) { 132 if (result == RESULT_BEHIND_CAPTIVE_PORTAL) {
133 if (state_ == STATE_MAYBE_BROKEN_BY_PORTAL) { 133 if (state_ == STATE_MAYBE_BROKEN_BY_PORTAL) {
134 SetState(STATE_BROKEN_BY_PORTAL); 134 SetState(STATE_BROKEN_BY_PORTAL);
135 MaybeOpenCaptivePortalLoginTab(); 135 MaybeOpenCaptivePortalLoginTab();
136 } 136 }
137 return; 137 return;
138 } 138 }
139 139
140 switch (state_) { 140 switch (state_) {
141 case STATE_MAYBE_BROKEN_BY_PORTAL: 141 case STATE_MAYBE_BROKEN_BY_PORTAL:
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 } 274 }
275 275
276 void CaptivePortalTabReloader::CheckForCaptivePortal() { 276 void CaptivePortalTabReloader::CheckForCaptivePortal() {
277 CaptivePortalService* service = 277 CaptivePortalService* service =
278 CaptivePortalServiceFactory::GetForProfile(profile_); 278 CaptivePortalServiceFactory::GetForProfile(profile_);
279 if (service) 279 if (service)
280 service->DetectCaptivePortal(); 280 service->DetectCaptivePortal();
281 } 281 }
282 282
283 } // namespace captive_portal 283 } // namespace captive_portal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698