OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 COMPONENTS_SECURITY_INTERSTITIALS_CORE_BAD_CLOCK_UI_H_ | 5 #ifndef COMPONENTS_SECURITY_INTERSTITIALS_CORE_BAD_CLOCK_UI_H_ |
6 #define COMPONENTS_SECURITY_INTERSTITIALS_CORE_BAD_CLOCK_UI_H_ | 6 #define COMPONENTS_SECURITY_INTERSTITIALS_CORE_BAD_CLOCK_UI_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "components/security_interstitials/core/controller_client.h" | 12 #include "components/security_interstitials/core/controller_client.h" |
13 #include "components/ssl_errors/error_classification.h" | 13 #include "components/ssl_errors/error_classification.h" |
14 #include "net/ssl/ssl_info.h" | 14 #include "net/ssl/ssl_info.h" |
15 #include "url/gurl.h" | 15 #include "url/gurl.h" |
16 | 16 |
| 17 namespace network_time { |
| 18 class NetworkTimeTracker; |
| 19 } |
| 20 |
17 namespace security_interstitials { | 21 namespace security_interstitials { |
18 | 22 |
19 // Provides UI for SSL errors caused by clock misconfigurations. | 23 // Provides UI for SSL errors caused by clock misconfigurations. |
20 class BadClockUI { | 24 class BadClockUI { |
21 public: | 25 public: |
22 BadClockUI(const GURL& request_url, | 26 BadClockUI(const GURL& request_url, |
23 int cert_error, // Should correspond to a NET_ERROR | 27 int cert_error, // Should correspond to a NET_ERROR |
24 const net::SSLInfo& ssl_info, | 28 const net::SSLInfo& ssl_info, |
25 const base::Time& time_triggered, // Time the error was triggered | 29 const base::Time& time_triggered, // Time the error was triggered |
| 30 const network_time::NetworkTimeTracker* network_time_tracker_, |
26 const std::string& languages, | 31 const std::string& languages, |
27 ControllerClient* controller_); | 32 ControllerClient* controller_); |
28 ~BadClockUI(); | 33 ~BadClockUI(); |
29 | 34 |
30 void PopulateStringsForHTML(base::DictionaryValue* load_time_data); | 35 void PopulateStringsForHTML(base::DictionaryValue* load_time_data); |
31 void HandleCommand(SecurityInterstitialCommands command); | 36 void HandleCommand(SecurityInterstitialCommands command); |
32 | 37 |
33 private: | 38 private: |
34 void PopulateClockStrings(base::DictionaryValue* load_time_data); | 39 void PopulateClockStrings(base::DictionaryValue* load_time_data); |
35 | 40 |
36 const GURL request_url_; | 41 const GURL request_url_; |
37 const int cert_error_; | 42 const int cert_error_; |
38 const net::SSLInfo ssl_info_; | 43 const net::SSLInfo ssl_info_; |
39 const base::Time time_triggered_; | 44 const base::Time time_triggered_; |
40 const std::string languages_; | 45 const std::string languages_; |
41 ControllerClient* controller_; | 46 ControllerClient* controller_; |
| 47 const network_time::NetworkTimeTracker* network_time_tracker_; |
42 | 48 |
43 DISALLOW_COPY_AND_ASSIGN(BadClockUI); | 49 DISALLOW_COPY_AND_ASSIGN(BadClockUI); |
44 }; | 50 }; |
45 | 51 |
46 } // security_interstitials | 52 } // security_interstitials |
47 | 53 |
48 #endif // COMPONENTS_SECURITY_INTERSTITIALS_CORE_BAD_CLOCK_UI_H_ | 54 #endif // COMPONENTS_SECURITY_INTERSTITIALS_CORE_BAD_CLOCK_UI_H_ |
OLD | NEW |