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

Side by Side Diff: chrome/browser/website_settings_model.h

Issue 9378014: Add website settings backend v 0.1 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Change names of the time variables for certs dates in the unittest. Created 8 years, 10 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 | Annotate | Revision Log
OLDNEW
(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 #include "googleurl/src/gurl.h"
10
11 namespace content {
12 struct SSLStatus;
13 }
14
15 class Profile;
16 class TabContentsWrapper;
17
18 // The |WebsiteSettingsModel| provides information about the connection and the
19 // identity of a website. The |WebsiteSettingsModel| is the backend for the
20 // WebsiteSettingsUI which displays this information.
21 class WebsiteSettingsModel {
22 public:
23 // Status of a connection to a website.
24 enum SiteConnectionStatus {
25 SITE_CONNECTION_STATUS_UNKNOWN = 0, // No status available.
26 SITE_CONNECTION_STATUS_ENCRYPTED, // Connection is encrypted.
27 SITE_CONNECTION_STATUS_MIXED_CONTENT, // Site has unencrypted content.
28 SITE_CONNECTION_STATUS_UNENCRYPTED, // Connection is not encrypted.
29 SITE_CONNECTION_STATUS_ENCRYPTED_ERROR, // Connection error occured.
30 SITE_CONNECTION_STATUS_INTERNAL_PAGE, // Internal site.
31 };
32
33 // Validation status of a website's identity.
34 enum SiteIdentityStatus {
35 // No status about the website's identity available.
36 SITE_IDENTITY_STATUS_UNKNOWN = 0,
37 // The website provided a valid certificate.
38 SITE_IDENTITY_STATUS_CERT,
39 // The website provided a valid EV certificate.
40 SITE_IDENTITY_STATUS_EV_CERT,
41 // The website provided a valid DNSSEC certificate.
42 SITE_IDENTITY_STATUS_DNSSEC_CERT,
43 // The website provided a valid certificate but no revocation check could be
44 // performed.
45 SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN,
46 // Site identity could not be verified because the site did not provide a
47 // certificate. This is the expected state for HTTP connections.
48 SITE_IDENTITY_STATUS_NO_CERT,
49 // An error occured while verifying the site identity.
50 SITE_IDENTITY_STATUS_ERROR,
51 // The site is a trusted internal chrome page.
52 SITE_IDENTITY_STATUS_INTERNAL_PAGE,
53 };
54
55 // Creates a WebsiteSettingsModel for the passed |url| using the given |ssl|
56 // status object to determine the status of the site's connection.
57 WebsiteSettingsModel(Profile* profile,
58 const GURL& url,
59 const content::SSLStatus& ssl);
60
61 virtual ~WebsiteSettingsModel();
62
63 // Accessors.
64 SiteConnectionStatus site_connection_status() const {
65 return site_connection_status_;
66 }
67
68 SiteIdentityStatus site_identity_status() const {
69 return site_identity_status_;
70 }
71
72 string16 site_connection_details() const {
73 return site_connection_details_;
74 }
75
76 string16 site_identity_details() const {
77 return site_identity_details_;
78 }
79
80 string16 organization_name() const {
81 return organization_name_;
82 }
83
84 private:
85 // Initializes the |WebsiteSettingsModel|.
86 void Init(Profile* profile,
87 const GURL& url,
88 const content::SSLStatus& ssl);
89
90 // Status of the website's identity verification check.
91 SiteIdentityStatus site_identity_status_;
92
93 // Status of the connection to the website.
94 SiteConnectionStatus site_connection_status_;
95
96 // Details about the website's identity. If the website's identity has been
97 // verified then |site_identity_details_| contains who verified the identity.
98 string16 site_identity_details_;
99
100 // Details about the connection to the website. In case of an encrypted
101 // connection |site_connection_details_| contains encryption details, like
102 // encryption strength and ssl protocol version.
103 string16 site_connection_details_;
104
105 // For websites that provided an EV certificate |orgainization_name_| contains
106 // the organization name of the certificate. In all other cases
107 // |organization_name| is an empty string.
108 string16 organization_name_;
109
110 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsModel);
111 };
112
113 #endif // CHROME_BROWSER_WEBSITE_SETTINGS_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/website_settings_model.cc » ('j') | chrome/browser/website_settings_model_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698