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

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

Issue 1169213006: Make ConnectionSecurityHelper a namespace instead of a class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 6 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_CONNECTION_SECURITY_HELPER_H_
6 #define CHROME_BROWSER_SSL_CONNECTION_SECURITY_HELPER_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 class is responsible for computing the security level of a page.
16 class ConnectionSecurityHelper {
17 public:
18 // TODO(wtc): unify this enum with SecurityStyle. We
19 // don't need two sets of security UI levels. SECURITY_STYLE_AUTHENTICATED
20 // needs to be refined into three levels: warning, standard, and EV.
21 // See crbug.com/425728
22 //
23 // If you reorder, add, or delete values from this enum, you must also
24 // update the UI icons in ToolbarModelImpl::GetIconForSecurityLevel.
25 //
26 // A Java counterpart will be generated for this enum.
27 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.ssl
28 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ConnectionSecurityHelperSecurityLevel
29 enum SecurityLevel {
30 // HTTP/no URL
31 NONE,
32
33 // HTTPS with valid EV cert
34 EV_SECURE,
35
36 // HTTPS (non-EV)
37 SECURE,
38
39 // HTTPS, but unable to check certificate revocation status or with insecure
40 // content on the page
41 SECURITY_WARNING,
42
43 // HTTPS, but the certificate verification chain is anchored on a
44 // certificate that was installed by the system administrator
45 SECURITY_POLICY_WARNING,
46
47 // Attempted HTTPS and failed, page not authenticated
48 SECURITY_ERROR,
49 };
50
51 // Returns a security level describing the overall security state of
52 // the given |WebContents|.
53 static SecurityLevel GetSecurityLevelForWebContents(
54 const content::WebContents* web_contents);
55
56 // Returns the content::SecurityStyle for the given |web_contents|.
57 // Note: This is a lossy operation. Not all of the policies
58 // that can be expressed by a SecurityLevel (a //chrome concept) can
59 // be expressed by a content::SecurityStyle.
60 // In general, code in //chrome should prefer to use
61 // GetSecurityLevelForWebContents() to determine security policy, and
62 // only use this function when policy needs to be supplied back to
63 // layers in //content.
64 static content::SecurityStyle GetSecurityStyleForWebContents(
65 const content::WebContents* web_contents);
66
67 private:
68 DISALLOW_IMPLICIT_CONSTRUCTORS(ConnectionSecurityHelper);
69 };
70
71 #endif // CHROME_BROWSER_SSL_CONNECTION_SECURITY_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ssl/connection_security_android.cc ('k') | chrome/browser/ssl/connection_security_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698