| 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_H_ |
| 6 #define CHROME_BROWSER_SSL_CONNECTION_SECURITY_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "content/public/common/security_style.h" |
| 10 |
| 11 namespace content { |
| 12 class WebContents; |
| 13 } // namespace content |
| 14 |
| 15 // This namespace contains functions responsible for computing the |
| 16 // connection security status of a page. |
| 17 namespace connection_security { |
| 18 |
| 19 // TODO(wtc): unify this enum with SecurityStyle. We |
| 20 // don't need two sets of security UI levels. SECURITY_STYLE_AUTHENTICATED |
| 21 // needs to be refined into three levels: warning, standard, and EV. |
| 22 // See crbug.com/425728 |
| 23 // |
| 24 // If you reorder, add, or delete values from this enum, you must also |
| 25 // update the UI icons in ToolbarModelImpl::GetIconForSecurityLevel. |
| 26 // |
| 27 // A Java counterpart will be generated for this enum. |
| 28 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.ssl |
| 29 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ConnectionSecurityLevel |
| 30 enum SecurityLevel { |
| 31 // HTTP/no URL |
| 32 NONE, |
| 33 |
| 34 // HTTPS with valid EV cert |
| 35 EV_SECURE, |
| 36 |
| 37 // HTTPS (non-EV) |
| 38 SECURE, |
| 39 |
| 40 // HTTPS, but unable to check certificate revocation status or with insecure |
| 41 // content on the page |
| 42 SECURITY_WARNING, |
| 43 |
| 44 // HTTPS, but the certificate verification chain is anchored on a |
| 45 // certificate that was installed by the system administrator |
| 46 SECURITY_POLICY_WARNING, |
| 47 |
| 48 // Attempted HTTPS and failed, page not authenticated |
| 49 SECURITY_ERROR, |
| 50 }; |
| 51 |
| 52 // Returns a security level describing the overall security state of |
| 53 // the given |WebContents|. |
| 54 SecurityLevel GetSecurityLevelForWebContents( |
| 55 const content::WebContents* web_contents); |
| 56 |
| 57 // Returns the content::SecurityStyle for the given |web_contents|. |
| 58 // Note: This is a lossy operation. Not all of the policies |
| 59 // that can be expressed by a SecurityLevel (a //chrome concept) can |
| 60 // be expressed by a content::SecurityStyle. |
| 61 // In general, code in //chrome should prefer to use |
| 62 // GetSecurityLevelForWebContents() to determine security policy, and |
| 63 // only use this function when policy needs to be supplied back to |
| 64 // layers in //content. |
| 65 content::SecurityStyle GetSecurityStyleForWebContents( |
| 66 const content::WebContents* web_contents); |
| 67 |
| 68 } // namespace connection_security |
| 69 |
| 70 #endif // CHROME_BROWSER_SSL_CONNECTION_SECURITY_H_ |
| OLD | NEW |