OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_WEBSITE_SETTINGS_MODEL_H_ | |
6 #define CHROME_BROWSER_WEBSITE_SETTINGS_MODEL_H_ | |
7 | |
8 #include "base/string16.h" | |
9 | |
10 #include "googleurl/src/gurl.h" | |
11 | |
12 namespace content { | |
13 struct SSLStatus; | |
14 } | |
15 | |
16 class Profile; | |
17 class TabContentsWrapper; | |
18 | |
19 // The |WebsiteSettingsModel| provides information about the connection and the | |
20 // identity of a website. The |WebsiteSettingsModel| is the backend for the | |
21 // WebsiteSettingsUI which displays this information. | |
22 class WebsiteSettingsModel { | |
23 public: | |
24 // Status of a connection to a website. | |
25 enum SiteConnectionStatus { | |
26 SITE_CONNECTION_STATUS_NA = 0, // No status available. | |
27 SITE_CONNECTION_STATUS_ENCRYPTED, // Connection is encrypted. | |
28 SITE_CONNECTION_STATUS_MIXED_CONTENT, // Site has unencrypted content. | |
29 SITE_CONNECTION_STATUS_UNENCRYPTED, // Connection is not encrypted. | |
30 SITE_CONNECTION_STATUS_ENCRYPTED_ERROR, // Connection error occured. | |
31 SITE_CONNECTION_STATUS_INTERNAL_PAGE, // Internal site. | |
32 }; | |
33 | |
34 // Validation status of a website's identity. | |
35 enum SiteIdentityStatus { | |
36 // No status about the website's identity available. | |
37 SITE_IDENTITY_STATUS_NA = 0, | |
38 // The website provided a valid certificate. | |
39 SITE_IDENTITY_STATUS_CERT, | |
40 // The website provided a valid EV certificate. | |
41 SITE_IDENTITY_STATUS_EV_CERT, | |
42 // The website provided a valid certificate. | |
Finnur
2012/02/14 13:50:10
nit: valid *DnsSec* certificate?
markusheintz_
2012/02/14 19:02:53
Done.
| |
43 SITE_IDENTITY_STATUS_DNSSEC_CERT, | |
44 // The website provided a valid certificate by no revocation check could be | |
Finnur
2012/02/14 13:50:10
s/by/but/ ?
markusheintz_
2012/02/14 19:02:53
Done.
| |
45 // performed. | |
46 SITE_IDENTITY_STATUS_CERT_NOT_VERIFIED, | |
47 // Site identity could not be verified because the site did not provide a | |
48 // certificate. This is the expected state for HTTP connections. | |
49 SITE_IDENTITY_STATUS_NO_CERT, | |
50 // An error occured while verifying the site identity. | |
51 SITE_IDENTITY_STATUS_ERROR, | |
52 // The site is a trusted internal chrome page. | |
53 SITE_IDENTITY_STATUS_INTERNAL_PAGE, | |
54 }; | |
55 | |
56 // Creates a WebsiteSettingsModel for the passed |url| using the given |ssl| | |
57 // status object to determin the status of the site's connection. | |
Finnur
2012/02/14 13:50:10
s/determin/determine/
markusheintz_
2012/02/14 19:02:53
Done.
| |
58 WebsiteSettingsModel(Profile* profile, | |
59 const GURL& url, | |
60 const content::SSLStatus& ssl); | |
61 | |
62 virtual ~WebsiteSettingsModel(); | |
63 | |
64 // Accessors. | |
65 SiteConnectionStatus site_connection_status() const; | |
66 | |
67 SiteIdentityStatus site_identity_status() const; | |
68 | |
69 string16 site_connection_details() const; | |
70 | |
71 string16 site_identity_details() const; | |
72 | |
73 string16 organization_name() const; | |
74 | |
75 private: | |
76 // Initializes the |WebsiteSettingsModel|. | |
77 void Init(Profile* profile, | |
78 const GURL& url, | |
79 const content::SSLStatus& ssl); | |
80 | |
81 // Status of the website's identity verification check. | |
82 SiteIdentityStatus site_identity_status_; | |
83 | |
84 // Status of the connection to the website. | |
85 SiteConnectionStatus site_connection_status_; | |
86 | |
87 // Details about the website's identity. If the website's identity has been | |
88 // verified then |site_identity_details_| contains who verified the identity. | |
89 string16 site_identity_details_; | |
90 | |
91 // Details about the connection to the website. In case of an encrypted | |
92 // connection |site_connection_details_| contains encryption details, like | |
93 // encryption strength and ssl protocoll version. | |
Finnur
2012/02/14 13:50:10
s/protocoll/protocol/
markusheintz_
2012/02/14 19:02:53
Done.
| |
94 string16 site_connection_details_; | |
95 | |
96 // For websites that provided a EV certificate |orgainization_name_| contains | |
97 // the organization name of the certificate. In all other cases | |
98 // |organization_name| is an empty string. | |
99 string16 organization_name_; | |
100 | |
101 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsModel); | |
102 }; | |
103 | |
104 #endif // CHROME_BROWSER_WEBSITE_SETTINGS_MODEL_H_ | |
OLD | NEW |