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

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

Issue 1169213006: Make ConnectionSecurityHelper a namespace instead of a class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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_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_
OLDNEW
« no previous file with comments | « chrome/browser/ssl/connection_security_helper_android.cc ('k') | chrome/browser/ssl/connection_security_status.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698