Chromium Code Reviews| 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_STATUS_H_ | |
| 6 #define CHROME_BROWSER_SSL_CONNECTION_SECURITY_STATUS_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 ConnectionSecurityStatus { | |
|
estark
2015/06/09 21:39:50
Is naming a namespace like this allowed? (as oppos
Peter Kasting
2015/06/10 00:09:08
No: http://google-styleguide.googlecode.com/svn/tr
estark
2015/06/10 00:41:15
Ah, ok, I missed that, thanks. I renamed it to con
Peter Kasting
2015/06/10 01:53:36
I don't have a strong preference, the former just
estark
2015/06/10 04:16:17
Fair enough; changed to 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: ConnectionSecurityStatusSecurityLevel | |
| 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 ConnectionSecurityStatus | |
| 69 | |
| 70 #endif // CHROME_BROWSER_SSL_CONNECTION_SECURITY_STATUS_H_ | |
| OLD | NEW |