Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(453)

Side by Side Diff: chrome/browser/ssl/security_level_policy.h

Issue 1123943002: Move SecurityLevel into a class of its own (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pkasting nits Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_SECURITY_LEVEL_POLICY_H_
6 #define CHROME_BROWSER_SSL_SECURITY_LEVEL_POLICY_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 SecurityLevelPolicy {
16 public:
17 // TODO(wtc): unify ToolbarModel::SecurityLevel 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.
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.
20 //
21 // A Java counterpart will be generated for this enum.
22 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.ssl
23 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: SecurityLevelPolicySecurityLevel
24 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
25 // HTTP/no URL/user is editing
26 NONE = 0,
27
28 // HTTPS with valid EV cert
29 EV_SECURE = 1,
30
31 // HTTPS (non-EV)
32 SECURE = 2,
33
34 // HTTPS, but unable to check certificate revocation status or with insecure
35 // content on the page
36 SECURITY_WARNING = 3,
37
38 // HTTPS, but the certificate verification chain is anchored on a
39 // certificate that was installed by the system administrator
40 SECURITY_POLICY_WARNING = 4,
41
42 // Attempted HTTPS and failed, page not authenticated
43 SECURITY_ERROR = 5,
44
45 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
46 };
47
48 static SecurityLevel GetSecurityLevelForWebContents(
49 content::WebContents* web_contents);
50
51 private:
52 DISALLOW_IMPLICIT_CONSTRUCTORS(SecurityLevelPolicy);
Ryan Sleevi 2015/05/08 00:24:24 style: INDENT
estark 2015/05/09 02:29:08 Done.
53 };
54
55 #endif // CHROME_BROWSER_SSL_SECURITY_LEVEL_POLICY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698