Chromium Code Reviews| Index: chrome/browser/ssl/connection_security_helper.h |
| diff --git a/chrome/browser/ssl/connection_security_helper.h b/chrome/browser/ssl/connection_security_helper.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fd58bf8a4f8ca0022e11ca03f2f6e9d905fe3398 |
| --- /dev/null |
| +++ b/chrome/browser/ssl/connection_security_helper.h |
| @@ -0,0 +1,58 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_SSL_CONNECTION_SECURITY_HELPER_H_ |
| +#define CHROME_BROWSER_SSL_CONNECTION_SECURITY_HELPER_H_ |
| + |
| +#include "base/macros.h" |
| + |
| +namespace content { |
| +class WebContents; |
| +} // namespace content |
| + |
| +// This class is responsible for computing the security level of a page. |
| +class ConnectionSecurityHelper { |
| + public: |
| + // TODO(wtc): unify this enum with SecurityStyle. We |
|
felt
2015/05/12 00:01:26
Since this is being left in, can you put a link to
estark
2015/05/12 04:37:48
Done.
|
| + // don't need two sets of security UI levels. SECURITY_STYLE_AUTHENTICATED |
| + // needs to be refined into three levels: warning, standard, and EV. |
| + // |
| + // If you reorder, add, or delete values from this enum, you must also |
| + // update the UI icons in ToolbarModelImpl::GetIconForSecurityLevel. |
| + // |
| + // A Java counterpart will be generated for this enum. |
| + // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.ssl |
| + // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ConnectionSecurityHelperSecurityLevel |
| + enum SecurityLevel { |
| + // HTTP/no URL |
| + NONE, |
| + |
| + // HTTPS with valid EV cert |
| + EV_SECURE, |
| + |
| + // HTTPS (non-EV) |
| + SECURE, |
| + |
| + // HTTPS, but unable to check certificate revocation status or with insecure |
| + // content on the page |
| + SECURITY_WARNING, |
| + |
| + // HTTPS, but the certificate verification chain is anchored on a |
| + // certificate that was installed by the system administrator |
| + SECURITY_POLICY_WARNING, |
| + |
| + // Attempted HTTPS and failed, page not authenticated |
| + SECURITY_ERROR, |
| + |
| + NUM_SECURITY_LEVELS, |
| + }; |
| + |
| + static SecurityLevel GetSecurityLevelForWebContents( |
| + content::WebContents* web_contents); |
|
Ryan Sleevi
2015/05/12 01:03:29
Document? :)
estark
2015/05/12 04:37:48
Done.
|
| + |
| + private: |
| + DISALLOW_IMPLICIT_CONSTRUCTORS(ConnectionSecurityHelper); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_SSL_CONNECTION_SECURITY_HELPER_H_ |