OLD | NEW |
(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_ |
OLD | NEW |