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

Side by Side Diff: chrome/browser/captive_portal/captive_portal_login_detector.h

Issue 10020051: Open a login tab on captive portal detection on SSL loads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fix typo in comment, forward declare CaptivePortalTabReloader in the TabHelper Created 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_LOGIN_DETECTOR_H_
6 #define CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_LOGIN_DETECTOR_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "chrome/browser/captive_portal/captive_portal_service.h"
11
12 class Profile;
13
14 namespace captive_portal {
15
16 // Triggers a captive portal test on navigations that may indicate a captive
17 // portal has been logged into. Currently only tracks if a page was opened
18 // at a captive portal tab's login page, and triggers checks every navigation
19 // until there's no longer a captive portal, relying on the
20 // CaptivePortalService's throttling to prevent excessive server load.
21 //
22 // TODO(mmenke): If a page has been broken by a captive portal, and it's
23 // successfully reloaded, trigger a captive portal check.
24 class CaptivePortalLoginDetector {
25 public:
26 explicit CaptivePortalLoginDetector(Profile* profile);
27
28 ~CaptivePortalLoginDetector();
29
30 void OnStoppedLoading();
31 void OnCaptivePortalResults(Result previous_result, Result result);
32
33 bool is_login_tab() const { return is_login_tab_; }
34 void set_is_login_tab() { is_login_tab_ = true; }
35
36 private:
37 Profile* profile_;
38
39 // True if this is a login tab. Set manually, automatically cleared once
40 // login is detected.
41 bool is_login_tab_;
42
43 DISALLOW_COPY_AND_ASSIGN(CaptivePortalLoginDetector);
44 };
45
46 } // namespace captive_portal
47
48 #endif // CHROME_BROWSER_CAPTIVE_PORTAL_CAPTIVE_PORTAL_LOGIN_DETECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698