Index: chrome/browser/ssl/security_level_policy.h |
diff --git a/chrome/browser/ssl/security_level_policy.h b/chrome/browser/ssl/security_level_policy.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..28874cea7e9419af71cdb0d7e26d0887407604ee |
--- /dev/null |
+++ b/chrome/browser/ssl/security_level_policy.h |
@@ -0,0 +1,55 @@ |
+// 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_SECURITY_LEVEL_POLICY_H_ |
+#define CHROME_BROWSER_SSL_SECURITY_LEVEL_POLICY_H_ |
+ |
+#include "base/macros.h" |
+ |
+namespace content { |
+class WebContents; |
+} // namespace content |
+ |
+// This class is responsible for computing the security level of a page. |
+class SecurityLevelPolicy { |
+ public: |
+ // TODO(wtc): unify ToolbarModel::SecurityLevel with SecurityStyle. We |
+ // don't need two sets of security UI levels. SECURITY_STYLE_AUTHENTICATED |
+ // needs to be refined into three levels: warning, standard, and EV. |
Ryan Sleevi
2015/05/08 00:24:24
This TODO probably shouldn't be preserved - wtc no
felt
2015/05/08 00:27:23
there is a bug here: https://code.google.com/p/chr
estark
2015/05/08 04:54:33
I think we should remove the TODO because 1. there
Peter Kasting
2015/05/08 06:38:00
Hmm, to be pedantic, I don't think (1) or (2) are
estark
2015/05/09 02:29:08
Ok, fair enough. I'll leave it in for now.
|
+ // |
+ // A Java counterpart will be generated for this enum. |
+ // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.ssl |
+ // GENERATED_JAVA_CLASS_NAME_OVERRIDE: SecurityLevelPolicySecurityLevel |
+ enum SecurityLevel { |
Ryan Sleevi
2015/05/08 00:24:23
Why are you assigning explicit values? Enums will
estark
2015/05/09 02:29:08
Hmm, I'm not sure why they're there. (This was rel
felt
2015/05/12 00:01:26
A switch statement sounds much less likely to brea
estark
2015/05/12 04:37:47
Done. (And removed NUM_SECURITY_LEVELS which no lo
|
+ // HTTP/no URL/user is editing |
+ NONE = 0, |
+ |
+ // HTTPS with valid EV cert |
+ EV_SECURE = 1, |
+ |
+ // HTTPS (non-EV) |
+ SECURE = 2, |
+ |
+ // HTTPS, but unable to check certificate revocation status or with insecure |
+ // content on the page |
+ SECURITY_WARNING = 3, |
+ |
+ // HTTPS, but the certificate verification chain is anchored on a |
+ // certificate that was installed by the system administrator |
+ SECURITY_POLICY_WARNING = 4, |
+ |
+ // Attempted HTTPS and failed, page not authenticated |
+ SECURITY_ERROR = 5, |
+ |
+ NUM_SECURITY_LEVELS = 6, |
Ryan Sleevi
2015/05/08 00:24:24
Is this necessary?
estark
2015/05/08 04:54:32
It's used to sanity check the icons that the secur
|
+ }; |
+ |
+ static SecurityLevel GetSecurityLevelForWebContents( |
+ content::WebContents* web_contents); |
+ |
+ private: |
+DISALLOW_IMPLICIT_CONSTRUCTORS(SecurityLevelPolicy); |
Ryan Sleevi
2015/05/08 00:24:24
style: INDENT
estark
2015/05/09 02:29:08
Done.
|
+}; |
+ |
+#endif // CHROME_BROWSER_SSL_SECURITY_LEVEL_POLICY_H_ |