OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_SSL_CONNECTION_SECURITY_HELPER_H_ | |
6 #define CHROME_BROWSER_SSL_CONNECTION_SECURITY_HELPER_H_ | |
7 | |
8 #include "base/macros.h" | |
9 | |
10 namespace content { | |
11 class WebContents; | |
12 } // namespace content | |
13 | |
14 // This class is responsible for computing the security level of a page. | |
15 class ConnectionSecurityHelper { | |
16 public: | |
17 // TODO(wtc): unify ToolbarModel::SecurityLevel with SecurityStyle. We | |
18 // don't need two sets of security UI levels. SECURITY_STYLE_AUTHENTICATED | |
19 // needs to be refined into three levels: warning, standard, and EV. | |
20 // | |
21 // If you reorder, add, or delete values from this enum, you must also | |
22 // update the UI icons in ToolbarModelImpl::GetIconForSecurityLevel. | |
23 // | |
24 // A Java counterpart will be generated for this enum. | |
25 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.ssl | |
26 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ConnectionSecurityHelperSecurityLevel | |
27 enum SecurityLevel { | |
28 // HTTP/no URL/user is editing | |
Peter Kasting
2015/05/09 04:34:56
Nit: Eliminate "user is editing" since at this lev
estark
2015/05/11 01:59:25
Done.
| |
29 NONE, | |
30 | |
31 // HTTPS with valid EV cert | |
32 EV_SECURE, | |
33 | |
34 // HTTPS (non-EV) | |
35 SECURE, | |
36 | |
37 // HTTPS, but unable to check certificate revocation status or with insecure | |
38 // content on the page | |
39 SECURITY_WARNING, | |
40 | |
41 // HTTPS, but the certificate verification chain is anchored on a | |
42 // certificate that was installed by the system administrator | |
43 SECURITY_POLICY_WARNING, | |
44 | |
45 // Attempted HTTPS and failed, page not authenticated | |
46 SECURITY_ERROR, | |
47 | |
48 NUM_SECURITY_LEVELS, | |
49 }; | |
50 | |
51 static SecurityLevel GetSecurityLevelForWebContents( | |
52 content::WebContents* web_contents); | |
53 | |
54 private: | |
55 DISALLOW_IMPLICIT_CONSTRUCTORS(ConnectionSecurityHelper); | |
56 }; | |
57 | |
58 #endif // CHROME_BROWSER_SSL_CONNECTION_SECURITY_HELPER_H_ | |
OLD | NEW |