Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ |
| 6 #define CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ | 6 #define CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 59 class SSLErrorHandler : public content::WebContentsUserData<SSLErrorHandler>, | 59 class SSLErrorHandler : public content::WebContentsUserData<SSLErrorHandler>, |
| 60 public content::WebContentsObserver, | 60 public content::WebContentsObserver, |
| 61 public content::NotificationObserver { | 61 public content::NotificationObserver { |
| 62 public: | 62 public: |
| 63 typedef base::Callback<void(content::WebContents*)> TimerStartedCallback; | 63 typedef base::Callback<void(content::WebContents*)> TimerStartedCallback; |
| 64 | 64 |
| 65 // Events for UMA. Do not rename or remove values, add new values to the end. | 65 // Events for UMA. Do not rename or remove values, add new values to the end. |
| 66 // Public for testing. | 66 // Public for testing. |
| 67 enum UMAEvent { | 67 enum UMAEvent { |
| 68 HANDLE_ALL = 0, | 68 HANDLE_ALL = 0, |
| 69 SHOW_CAPTIVE_PORTAL_INTERSTITIAL_NONOVERRIDABLE, | 69 SHOW_CAPTIVE_PORTAL_INTERSTITIAL_NONOVERRIDABLE, |
|
Mark P
2017/04/05 18:18:25
optional nit: prefer labeling = 1, ... as recommen
elawrence
2017/04/05 23:05:16
Done.
| |
| 70 SHOW_CAPTIVE_PORTAL_INTERSTITIAL_OVERRIDABLE, | 70 SHOW_CAPTIVE_PORTAL_INTERSTITIAL_OVERRIDABLE, |
| 71 SHOW_SSL_INTERSTITIAL_NONOVERRIDABLE, | 71 SHOW_SSL_INTERSTITIAL_NONOVERRIDABLE, |
| 72 SHOW_SSL_INTERSTITIAL_OVERRIDABLE, | 72 SHOW_SSL_INTERSTITIAL_OVERRIDABLE, |
| 73 WWW_MISMATCH_FOUND, | 73 WWW_MISMATCH_FOUND, // Deprecated by WWW_MISMATCH_FOUND_IN_SAN |
| 74 WWW_MISMATCH_URL_AVAILABLE, | 74 WWW_MISMATCH_URL_AVAILABLE, |
| 75 WWW_MISMATCH_URL_NOT_AVAILABLE, | 75 WWW_MISMATCH_URL_NOT_AVAILABLE, |
| 76 SHOW_BAD_CLOCK, | 76 SHOW_BAD_CLOCK, |
| 77 CAPTIVE_PORTAL_CERT_FOUND, | 77 CAPTIVE_PORTAL_CERT_FOUND, |
| 78 WWW_MISMATCH_FOUND_IN_SAN, | |
| 78 SSL_ERROR_HANDLER_EVENT_COUNT | 79 SSL_ERROR_HANDLER_EVENT_COUNT |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 // This delegate allows unit tests to provide their own Chrome specific | 82 // This delegate allows unit tests to provide their own Chrome specific |
| 82 // actions. | 83 // actions. |
| 83 class Delegate { | 84 class Delegate { |
| 84 public: | 85 public: |
| 85 virtual ~Delegate() {} | 86 virtual ~Delegate() {} |
| 86 virtual void CheckForCaptivePortal() = 0; | 87 virtual void CheckForCaptivePortal() = 0; |
| 87 virtual bool GetSuggestedUrl(const std::vector<std::string>& dns_names, | 88 virtual bool GetSuggestedUrl(const std::vector<std::string>& dns_names, |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 193 base::OneShotTimer timer_; | 194 base::OneShotTimer timer_; |
| 194 | 195 |
| 195 std::unique_ptr<CommonNameMismatchHandler> common_name_mismatch_handler_; | 196 std::unique_ptr<CommonNameMismatchHandler> common_name_mismatch_handler_; |
| 196 | 197 |
| 197 base::WeakPtrFactory<SSLErrorHandler> weak_ptr_factory_; | 198 base::WeakPtrFactory<SSLErrorHandler> weak_ptr_factory_; |
| 198 | 199 |
| 199 DISALLOW_COPY_AND_ASSIGN(SSLErrorHandler); | 200 DISALLOW_COPY_AND_ASSIGN(SSLErrorHandler); |
| 200 }; | 201 }; |
| 201 | 202 |
| 202 #endif // CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ | 203 #endif // CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ |
| OLD | NEW |