| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_ |
| 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_ | 6 #define CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 SITE_IDENTITY_STATUS_NO_CERT, | 59 SITE_IDENTITY_STATUS_NO_CERT, |
| 60 // An error occured while verifying the site identity. | 60 // An error occured while verifying the site identity. |
| 61 SITE_IDENTITY_STATUS_ERROR, | 61 SITE_IDENTITY_STATUS_ERROR, |
| 62 // The site is a trusted internal chrome page. | 62 // The site is a trusted internal chrome page. |
| 63 SITE_IDENTITY_STATUS_INTERNAL_PAGE, | 63 SITE_IDENTITY_STATUS_INTERNAL_PAGE, |
| 64 // The profile has accessed data using an administrator-provided | 64 // The profile has accessed data using an administrator-provided |
| 65 // certificate, so the site might be able to intercept data. | 65 // certificate, so the site might be able to intercept data. |
| 66 SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT, | 66 SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT, |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 // Validation status of a website's certificate via Certificate Transparency. |
| 70 enum CertTransparencyStatus { |
| 71 // No status about the website's certificate is available. |
| 72 CERT_TRANSPARENCY_STATUS_UNKNOWN = 0, |
| 73 // One or more SCTs present, none verified. |
| 74 CERT_TRANSPARENCY_STATUS_HAS_SCT, |
| 75 // One or more valid SCTs were presented for the server's certificate. |
| 76 CERT_TRANSPARENCY_STATUS_HAS_VALID_SCT, |
| 77 // XXX(rsleevi): Do we also plan to track "Presented SCTs, but none valid?" |
| 78 // or "Presented SCTs, but not by any trusted logs" (etc). |
| 79 }; |
| 80 |
| 69 // Creates a WebsiteSettings for the passed |url| using the given |ssl| status | 81 // Creates a WebsiteSettings for the passed |url| using the given |ssl| status |
| 70 // object to determine the status of the site's connection. The | 82 // object to determine the status of the site's connection. The |
| 71 // |WebsiteSettings| takes ownership of the |ui|. | 83 // |WebsiteSettings| takes ownership of the |ui|. |
| 84 // XXX(rsleevi): Pass through the SCT store. |
| 72 WebsiteSettings(WebsiteSettingsUI* ui, | 85 WebsiteSettings(WebsiteSettingsUI* ui, |
| 73 Profile* profile, | 86 Profile* profile, |
| 74 TabSpecificContentSettings* tab_specific_content_settings, | 87 TabSpecificContentSettings* tab_specific_content_settings, |
| 75 InfoBarService* infobar_service, | 88 InfoBarService* infobar_service, |
| 76 const GURL& url, | 89 const GURL& url, |
| 77 const content::SSLStatus& ssl, | 90 const content::SSLStatus& ssl, |
| 78 content::CertStore* cert_store); | 91 content::CertStore* cert_store); |
| 79 virtual ~WebsiteSettings(); | 92 virtual ~WebsiteSettings(); |
| 80 | 93 |
| 81 // This method is called when ever a permission setting is changed. | 94 // This method is called when ever a permission setting is changed. |
| (...skipping 24 matching lines...) Expand all Loading... |
| 106 } | 119 } |
| 107 | 120 |
| 108 string16 site_identity_details() const { | 121 string16 site_identity_details() const { |
| 109 return site_identity_details_; | 122 return site_identity_details_; |
| 110 } | 123 } |
| 111 | 124 |
| 112 string16 organization_name() const { | 125 string16 organization_name() const { |
| 113 return organization_name_; | 126 return organization_name_; |
| 114 } | 127 } |
| 115 | 128 |
| 129 string16 cert_transparency_details() const { |
| 130 return cert_transparency_details_; |
| 131 } |
| 132 |
| 116 // SiteDataObserver implementation. | 133 // SiteDataObserver implementation. |
| 117 virtual void OnSiteDataAccessed() OVERRIDE; | 134 virtual void OnSiteDataAccessed() OVERRIDE; |
| 118 | 135 |
| 119 private: | 136 private: |
| 120 // Initializes the |WebsiteSettings|. | 137 // Initializes the |WebsiteSettings|. |
| 121 void Init(Profile* profile, | 138 void Init(Profile* profile, |
| 122 const GURL& url, | 139 const GURL& url, |
| 123 const content::SSLStatus& ssl); | 140 const content::SSLStatus& ssl); |
| 124 | 141 |
| 125 // Sets (presents) the information about the site's permissions in the |ui_|. | 142 // Sets (presents) the information about the site's permissions in the |ui_|. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 // Status of the website's identity verification check. | 174 // Status of the website's identity verification check. |
| 158 SiteIdentityStatus site_identity_status_; | 175 SiteIdentityStatus site_identity_status_; |
| 159 | 176 |
| 160 // For secure connection |cert_id_| is set to the ID of the server | 177 // For secure connection |cert_id_| is set to the ID of the server |
| 161 // certificate. For non secure connections |cert_id_| is 0. | 178 // certificate. For non secure connections |cert_id_| is 0. |
| 162 int cert_id_; | 179 int cert_id_; |
| 163 | 180 |
| 164 // Status of the connection to the website. | 181 // Status of the connection to the website. |
| 165 SiteConnectionStatus site_connection_status_; | 182 SiteConnectionStatus site_connection_status_; |
| 166 | 183 |
| 184 CertTransparencyStatus cert_transparency_status_; |
| 185 |
| 167 // TODO(markusheintz): Move the creation of all the string16 typed UI | 186 // TODO(markusheintz): Move the creation of all the string16 typed UI |
| 168 // strings below to the corresponding UI code, in order to prevent | 187 // strings below to the corresponding UI code, in order to prevent |
| 169 // unnecessary UTF-8 string conversions. | 188 // unnecessary UTF-8 string conversions. |
| 170 | 189 |
| 171 // Details about the website's identity. If the website's identity has been | 190 // Details about the website's identity. If the website's identity has been |
| 172 // verified then |site_identity_details_| contains who verified the identity. | 191 // verified then |site_identity_details_| contains who verified the identity. |
| 173 // This string will be displayed in the UI. | 192 // This string will be displayed in the UI. |
| 174 string16 site_identity_details_; | 193 string16 site_identity_details_; |
| 175 | 194 |
| 176 // Details about the connection to the website. In case of an encrypted | 195 // Details about the connection to the website. In case of an encrypted |
| 177 // connection |site_connection_details_| contains encryption details, like | 196 // connection |site_connection_details_| contains encryption details, like |
| 178 // encryption strength and ssl protocol version. This string will be | 197 // encryption strength and ssl protocol version. This string will be |
| 179 // displayed in the UI. | 198 // displayed in the UI. |
| 180 string16 site_connection_details_; | 199 string16 site_connection_details_; |
| 181 | 200 |
| 182 // For websites that provided an EV certificate |orgainization_name_| | 201 // For websites that provided an EV certificate |orgainization_name_| |
| 183 // contains the organization name of the certificate. In all other cases | 202 // contains the organization name of the certificate. In all other cases |
| 184 // |organization_name| is an empty string. This string will be displayed in | 203 // |organization_name| is an empty string. This string will be displayed in |
| 185 // the UI. | 204 // the UI. |
| 186 string16 organization_name_; | 205 string16 organization_name_; |
| 187 | 206 |
| 207 // For websites that were successfully checked using Certificate |
| 208 // Transparency, contains a description about the validation status and which |
| 209 // logs were used. This string will be displayed in the UI. |
| 210 string16 cert_transparency_details_; |
| 211 |
| 188 // The |CertStore| provides all X509Certificates. | 212 // The |CertStore| provides all X509Certificates. |
| 189 content::CertStore* cert_store_; | 213 content::CertStore* cert_store_; |
| 190 | 214 |
| 191 // The |HostContentSettingsMap| is the service that provides and manages | 215 // The |HostContentSettingsMap| is the service that provides and manages |
| 192 // content settings (aka. site permissions). | 216 // content settings (aka. site permissions). |
| 193 HostContentSettingsMap* content_settings_; | 217 HostContentSettingsMap* content_settings_; |
| 194 | 218 |
| 195 // Used to request the number of page visits. | 219 // Used to request the number of page visits. |
| 196 CancelableRequestConsumer visit_count_request_consumer_; | 220 CancelableRequestConsumer visit_count_request_consumer_; |
| 197 | 221 |
| 198 DISALLOW_COPY_AND_ASSIGN(WebsiteSettings); | 222 DISALLOW_COPY_AND_ASSIGN(WebsiteSettings); |
| 199 }; | 223 }; |
| 200 | 224 |
| 201 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_ | 225 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_ |
| OLD | NEW |