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

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: Remove unrelated changes Created 8 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/website_settings_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CertStore;
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_UNKNOWN = 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_UNKNOWN = 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 DNSSEC certificate.
43 SITE_IDENTITY_STATUS_DNSSEC_CERT,
44 // The website provided a valid certificate but no revocation check could be
45 // performed.
46 SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN,
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 determine the status of the site's connection.
58 WebsiteSettingsModel(Profile* profile,
59 const GURL& url,
60 const content::SSLStatus& ssl,
61 CertStore* cert_store);
62
63 virtual ~WebsiteSettingsModel();
64
65 // Accessors.
66 SiteConnectionStatus site_connection_status() const {
67 return site_connection_status_;
68 }
69
70 SiteIdentityStatus site_identity_status() const {
71 return site_identity_status_;
72 }
73
74 string16 site_connection_details() const {
75 return site_connection_details_;
76 }
77
78 string16 site_identity_details() const {
79 return site_identity_details_;
80 }
81
82 string16 organization_name() const {
83 return organization_name_;
84 }
85
86 private:
87 // Initializes the |WebsiteSettingsModel|.
88 void Init(Profile* profile,
89 const GURL& url,
90 const content::SSLStatus& ssl);
91
92 // Status of the website's identity verification check.
93 SiteIdentityStatus site_identity_status_;
94
95 // Status of the connection to the website.
96 SiteConnectionStatus site_connection_status_;
97
98 // Details about the website's identity. If the website's identity has been
99 // verified then |site_identity_details_| contains who verified the identity.
100 string16 site_identity_details_;
101
102 // Details about the connection to the website. In case of an encrypted
103 // connection |site_connection_details_| contains encryption details, like
104 // encryption strength and ssl protocol version.
105 string16 site_connection_details_;
106
107 // For websites that provided an EV certificate |orgainization_name_| contains
108 // the organization name of the certificate. In all other cases
109 // |organization_name| is an empty string.
110 string16 organization_name_;
111
112 // The |CertStore| provides all X509Certificates.
113 CertStore* cert_store_;
114
115 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsModel);
116 };
117
118 #endif // CHROME_BROWSER_WEBSITE_SETTINGS_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/website_settings_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698