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

Side by Side Diff: content/public/common/security_style.h

Issue 1181293003: Expand SecurityStyleChanged interfaces to include explanations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments, style tweaks 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_PUBLIC_COMMON_SECURITY_STYLE_H_ 5 #ifndef CONTENT_PUBLIC_COMMON_SECURITY_STYLE_H_
6 #define CONTENT_PUBLIC_COMMON_SECURITY_STYLE_H_ 6 #define CONTENT_PUBLIC_COMMON_SECURITY_STYLE_H_
7 7
8 #include <string>
9 #include <vector>
10
8 namespace content { 11 namespace content {
9 12
10 // Various aspects of the UI change their appearance according to the security 13 // Various aspects of the UI change their appearance according to the security
11 // context in which they are displayed. For example, the location bar displays 14 // context in which they are displayed. For example, the location bar displays
12 // a lock icon when it is displayed during a valid SSL connection. 15 // a lock icon when it is displayed during a valid SSL connection.
13 // SecuritySyle enumerates these styles, but it is up to the UI elements to 16 // SecuritySyle enumerates these styles, but it is up to the UI elements to
14 // adjust their display appropriately. 17 // adjust their display appropriately.
15 enum SecurityStyle { 18 enum SecurityStyle {
16 // SECURITY_STYLE_UNKNOWN indicates that we do not know the proper security 19 // SECURITY_STYLE_UNKNOWN indicates that we do not know the proper security
17 // style for this object. 20 // style for this object.
(...skipping 14 matching lines...) Expand all
32 // authenticated manner, but there were security issues with the retrieval or 35 // authenticated manner, but there were security issues with the retrieval or
33 // the object interacted with less secure objects. 36 // the object interacted with less secure objects.
34 SECURITY_STYLE_WARNING, 37 SECURITY_STYLE_WARNING,
35 38
36 // SECURITY_STYLE_AUTHENTICATED indicates that we successfully retrieved this 39 // SECURITY_STYLE_AUTHENTICATED indicates that we successfully retrieved this
37 // object over an authenticated protocol, such as HTTPS. 40 // object over an authenticated protocol, such as HTTPS.
38 SECURITY_STYLE_AUTHENTICATED, 41 SECURITY_STYLE_AUTHENTICATED,
39 SECURITY_STYLE_LAST = SECURITY_STYLE_AUTHENTICATED 42 SECURITY_STYLE_LAST = SECURITY_STYLE_AUTHENTICATED
40 }; 43 };
41 44
45 // A human-readable summary phrase and more detailed description of a
46 // security property that was used to compute the SecurityStyle of a
47 // resource. An example summary phrase would be "Expired Certificate",
48 // with a description along the lines of "This site's certificate chain
49 // contains errors (NET::CERT_DATE_INVALID)".
Peter Kasting 2015/06/16 06:29:11 Nit: "net::"?
estark 2015/06/16 15:32:35 Done.
50 struct SecurityStyleProperty {
Peter Kasting 2015/06/16 06:29:11 Nit: I might name this "SecurityStyleExplanation"
estark 2015/06/16 15:32:35 Done. I went with SecurityStyleExplanation instead
51 SecurityStyleProperty();
52 SecurityStyleProperty(const std::string& summary_input,
53 const std::string& description_input);
54 ~SecurityStyleProperty();
55
56 std::string summary;
57 std::string description;
58 };
59
60 // A |SecurityStyleExplanation| contains human-readable explanations for
61 // why a particular |SecurityStyle| was chosen. Each
62 // |SecurityStyleProperty| is a single security property of a page (for
63 // example, an expired certificate or the presence of active mixed
64 // content). An explanation can have multiple |warning_explanations| and
65 // multiple |broken_explanations|, and both can be non-empty if a site
66 // has multiple issues.
67 struct SecurityStyleExplanation {
68 SecurityStyleExplanation();
69 ~SecurityStyleExplanation();
70
71 std::vector<SecurityStyleProperty> warning_explanations;
72 std::vector<SecurityStyleProperty> broken_explanations;
73 };
74
42 } // namespace content 75 } // namespace content
43 76
44 #endif // CONTENT_PUBLIC_COMMON_SECURITY_STYLE_H_ 77 #endif // CONTENT_PUBLIC_COMMON_SECURITY_STYLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698