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 this enum 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 // See crbug.com/425728 |
| 21 // |
| 22 // If you reorder, add, or delete values from this enum, you must also |
| 23 // update the UI icons in ToolbarModelImpl::GetIconForSecurityLevel. |
| 24 // |
| 25 // A Java counterpart will be generated for this enum. |
| 26 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.ssl |
| 27 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ConnectionSecurityHelperSecurityLevel |
| 28 enum SecurityLevel { |
| 29 // HTTP/no URL |
| 30 NONE, |
| 31 |
| 32 // HTTPS with valid EV cert |
| 33 EV_SECURE, |
| 34 |
| 35 // HTTPS (non-EV) |
| 36 SECURE, |
| 37 |
| 38 // HTTPS, but unable to check certificate revocation status or with insecure |
| 39 // content on the page |
| 40 SECURITY_WARNING, |
| 41 |
| 42 // HTTPS, but the certificate verification chain is anchored on a |
| 43 // certificate that was installed by the system administrator |
| 44 SECURITY_POLICY_WARNING, |
| 45 |
| 46 // Attempted HTTPS and failed, page not authenticated |
| 47 SECURITY_ERROR, |
| 48 }; |
| 49 |
| 50 // Returns a security level describing the overall security state of |
| 51 // the given |WebContents|. |
| 52 static SecurityLevel GetSecurityLevelForWebContents( |
| 53 content::WebContents* web_contents); |
| 54 |
| 55 private: |
| 56 DISALLOW_IMPLICIT_CONSTRUCTORS(ConnectionSecurityHelper); |
| 57 }; |
| 58 |
| 59 #endif // CHROME_BROWSER_SSL_CONNECTION_SECURITY_HELPER_H_ |
OLD | NEW |