Chromium Code Reviews| Index: chrome/browser/website_settings_model.h |
| diff --git a/chrome/browser/website_settings_model.h b/chrome/browser/website_settings_model.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..7a83f49f99ae5c8f49348b6ab7cdbe32d06f9975 |
| --- /dev/null |
| +++ b/chrome/browser/website_settings_model.h |
| @@ -0,0 +1,104 @@ |
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_WEBSITE_SETTINGS_MODEL_H_ |
| +#define CHROME_BROWSER_WEBSITE_SETTINGS_MODEL_H_ |
| + |
| +#include "base/string16.h" |
| + |
| +#include "googleurl/src/gurl.h" |
| + |
| +namespace content { |
| +struct SSLStatus; |
| +} |
| + |
| +class Profile; |
| +class TabContentsWrapper; |
| + |
| +// The |WebsiteSettingsModel| provides information about the connection and the |
| +// identity of a website. The |WebsiteSettingsModel| is the backend for the |
| +// WebsiteSettingsUI which displays this information. |
| +class WebsiteSettingsModel { |
| + public: |
| + // Status of a connection to a website. |
| + enum SiteConnectionStatus { |
| + SITE_CONNECTION_STATUS_NA = 0, // No status available. |
| + SITE_CONNECTION_STATUS_ENCRYPTED, // Connection is encrypted. |
| + SITE_CONNECTION_STATUS_MIXED_CONTENT, // Site has unencrypted content. |
| + SITE_CONNECTION_STATUS_UNENCRYPTED, // Connection is not encrypted. |
| + SITE_CONNECTION_STATUS_ENCRYPTED_ERROR, // Connection error occured. |
| + SITE_CONNECTION_STATUS_INTERNAL_PAGE, // Internal site. |
| + }; |
| + |
| + // Validation status of a website's identity. |
| + enum SiteIdentityStatus { |
| + // No status about the website's identity available. |
| + SITE_IDENTITY_STATUS_NA = 0, |
| + // The website provided a valid certificate. |
| + SITE_IDENTITY_STATUS_CERT, |
| + // The website provided a valid EV certificate. |
| + SITE_IDENTITY_STATUS_EV_CERT, |
| + // 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.
|
| + SITE_IDENTITY_STATUS_DNSSEC_CERT, |
| + // 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.
|
| + // performed. |
| + SITE_IDENTITY_STATUS_CERT_NOT_VERIFIED, |
| + // Site identity could not be verified because the site did not provide a |
| + // certificate. This is the expected state for HTTP connections. |
| + SITE_IDENTITY_STATUS_NO_CERT, |
| + // An error occured while verifying the site identity. |
| + SITE_IDENTITY_STATUS_ERROR, |
| + // The site is a trusted internal chrome page. |
| + SITE_IDENTITY_STATUS_INTERNAL_PAGE, |
| + }; |
| + |
| + // Creates a WebsiteSettingsModel for the passed |url| using the given |ssl| |
| + // 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.
|
| + WebsiteSettingsModel(Profile* profile, |
| + const GURL& url, |
| + const content::SSLStatus& ssl); |
| + |
| + virtual ~WebsiteSettingsModel(); |
| + |
| + // Accessors. |
| + SiteConnectionStatus site_connection_status() const; |
| + |
| + SiteIdentityStatus site_identity_status() const; |
| + |
| + string16 site_connection_details() const; |
| + |
| + string16 site_identity_details() const; |
| + |
| + string16 organization_name() const; |
| + |
| + private: |
| + // Initializes the |WebsiteSettingsModel|. |
| + void Init(Profile* profile, |
| + const GURL& url, |
| + const content::SSLStatus& ssl); |
| + |
| + // Status of the website's identity verification check. |
| + SiteIdentityStatus site_identity_status_; |
| + |
| + // Status of the connection to the website. |
| + SiteConnectionStatus site_connection_status_; |
| + |
| + // Details about the website's identity. If the website's identity has been |
| + // verified then |site_identity_details_| contains who verified the identity. |
| + string16 site_identity_details_; |
| + |
| + // Details about the connection to the website. In case of an encrypted |
| + // connection |site_connection_details_| contains encryption details, like |
| + // encryption strength and ssl protocoll version. |
|
Finnur
2012/02/14 13:50:10
s/protocoll/protocol/
markusheintz_
2012/02/14 19:02:53
Done.
|
| + string16 site_connection_details_; |
| + |
| + // For websites that provided a EV certificate |orgainization_name_| contains |
| + // the organization name of the certificate. In all other cases |
| + // |organization_name| is an empty string. |
| + string16 organization_name_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsModel); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_WEBSITE_SETTINGS_MODEL_H_ |