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

Unified 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: Fix nits and add tests. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/website_settings_model.cc » ('j') | chrome/browser/website_settings_model.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..a7c3a1cb4e5014396ab0bb30191318ca107659eb
--- /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"
+
wtc 2012/02/15 02:14:29 Nit: this blank line is not necessary.
markusheintz_ 2012/02/15 19:04:18 Done.
+#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.
wtc 2012/02/15 02:14:29 Nit: I don't know why you named this class Website
markusheintz_ 2012/02/15 19:04:18 This will become more than just a data model. Orig
+class WebsiteSettingsModel {
+ public:
+ // Status of a connection to a website.
+ enum SiteConnectionStatus {
+ SITE_CONNECTION_STATUS_NA = 0, // No status available.
wtc 2012/02/15 02:14:29 Nit: "N/A" stands for "not applicable" as opposed
markusheintz_ 2012/02/15 19:04:18 Done.
+ 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.
wtc 2012/02/15 02:14:29 I don't know what "Internal" means here. Internal
markusheintz_ 2012/02/15 19:04:18 Internal to chrome. Internal pages like chrome://s
+ };
+
+ // 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 DnsSec certificate.
wtc 2012/02/15 02:14:29 Nit: DnsSec => DNSSEC
markusheintz_ 2012/02/15 19:04:18 Done.
+ SITE_IDENTITY_STATUS_DNSSEC_CERT,
+ // The website provided a valid certificate but no revocation check could be
+ // performed.
+ SITE_IDENTITY_STATUS_CERT_NOT_VERIFIED,
wtc 2012/02/15 02:14:29 Change "NOT_VERIFIED" to "REVOKE_STATUS_UNKNOWN" o
markusheintz_ 2012/02/15 19:04:18 Done. I chose REVOCATION_UNKNOWN.
+ // 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 determine the status of the site's connection.
+ 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 protocol version.
+ string16 site_connection_details_;
+
+ // For websites that provided a EV certificate |orgainization_name_| contains
wtc 2012/02/15 02:14:29 Nit: a EV => an EV
markusheintz_ 2012/02/15 19:04:18 Done.
+ // 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_
« no previous file with comments | « no previous file | chrome/browser/website_settings_model.cc » ('j') | chrome/browser/website_settings_model.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698