| 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/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 10 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 11 #include "components/content_settings/core/common/content_settings.h" | 11 #include "components/content_settings/core/common/content_settings.h" |
| 12 #include "components/content_settings/core/common/content_settings_types.h" | 12 #include "components/content_settings/core/common/content_settings_types.h" |
| 13 #include "components/security_state/security_state_model.h" | 13 #include "components/security_state/security_state_model.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 | 15 |
| 16 namespace content { | 16 namespace content { |
| 17 class CertStore; | |
| 18 class WebContents; | 17 class WebContents; |
| 19 } | 18 } |
| 20 | 19 |
| 20 namespace net { |
| 21 class X509Certificate; |
| 22 } |
| 23 |
| 21 class ChromeSSLHostStateDelegate; | 24 class ChromeSSLHostStateDelegate; |
| 22 class ChooserContextBase; | 25 class ChooserContextBase; |
| 23 class HostContentSettingsMap; | 26 class HostContentSettingsMap; |
| 24 class Profile; | 27 class Profile; |
| 25 class WebsiteSettingsUI; | 28 class WebsiteSettingsUI; |
| 26 | 29 |
| 27 // The |WebsiteSettings| provides information about a website's permissions, | 30 // The |WebsiteSettings| provides information about a website's permissions, |
| 28 // connection state and its identity. It owns a UI that displays the | 31 // connection state and its identity. It owns a UI that displays the |
| 29 // information and allows users to change the permissions. |WebsiteSettings| | 32 // information and allows users to change the permissions. |WebsiteSettings| |
| 30 // objects must be created on the heap. They destroy themselves after the UI is | 33 // objects must be created on the heap. They destroy themselves after the UI is |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 111 |
| 109 // Creates a WebsiteSettings for the passed |url| using the given |ssl| status | 112 // Creates a WebsiteSettings for the passed |url| using the given |ssl| status |
| 110 // object to determine the status of the site's connection. The | 113 // object to determine the status of the site's connection. The |
| 111 // |WebsiteSettings| takes ownership of the |ui|. | 114 // |WebsiteSettings| takes ownership of the |ui|. |
| 112 WebsiteSettings( | 115 WebsiteSettings( |
| 113 WebsiteSettingsUI* ui, | 116 WebsiteSettingsUI* ui, |
| 114 Profile* profile, | 117 Profile* profile, |
| 115 TabSpecificContentSettings* tab_specific_content_settings, | 118 TabSpecificContentSettings* tab_specific_content_settings, |
| 116 content::WebContents* web_contents, | 119 content::WebContents* web_contents, |
| 117 const GURL& url, | 120 const GURL& url, |
| 118 const security_state::SecurityStateModel::SecurityInfo& security_info, | 121 const security_state::SecurityStateModel::SecurityInfo& security_info); |
| 119 content::CertStore* cert_store); | |
| 120 ~WebsiteSettings() override; | 122 ~WebsiteSettings() override; |
| 121 | 123 |
| 122 void RecordWebsiteSettingsAction(WebsiteSettingsAction action); | 124 void RecordWebsiteSettingsAction(WebsiteSettingsAction action); |
| 123 | 125 |
| 124 // This method is called when ever a permission setting is changed. | 126 // This method is called when ever a permission setting is changed. |
| 125 void OnSitePermissionChanged(ContentSettingsType type, | 127 void OnSitePermissionChanged(ContentSettingsType type, |
| 126 ContentSetting value); | 128 ContentSetting value); |
| 127 | 129 |
| 128 // This method is called whenever access to an object is revoked. | 130 // This method is called whenever access to an object is revoked. |
| 129 void OnSiteChosenObjectDeleted(const ChooserUIInfo& ui_info, | 131 void OnSiteChosenObjectDeleted(const ChooserUIInfo& ui_info, |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 // settings UI is closed or not. | 186 // settings UI is closed or not. |
| 185 bool show_info_bar_; | 187 bool show_info_bar_; |
| 186 | 188 |
| 187 // The Omnibox URL of the website for which to display site permissions and | 189 // The Omnibox URL of the website for which to display site permissions and |
| 188 // site information. | 190 // site information. |
| 189 GURL site_url_; | 191 GURL site_url_; |
| 190 | 192 |
| 191 // Status of the website's identity verification check. | 193 // Status of the website's identity verification check. |
| 192 SiteIdentityStatus site_identity_status_; | 194 SiteIdentityStatus site_identity_status_; |
| 193 | 195 |
| 194 // For secure connection |cert_id_| is set to the ID of the server | 196 // For secure connection |certificate_| is set to the server certificate. |
| 195 // certificate. For non secure connections |cert_id_| is 0. | 197 scoped_refptr<net::X509Certificate> certificate_; |
| 196 int cert_id_; | |
| 197 | 198 |
| 198 // Status of the connection to the website. | 199 // Status of the connection to the website. |
| 199 SiteConnectionStatus site_connection_status_; | 200 SiteConnectionStatus site_connection_status_; |
| 200 | 201 |
| 201 // TODO(markusheintz): Move the creation of all the base::string16 typed UI | 202 // TODO(markusheintz): Move the creation of all the base::string16 typed UI |
| 202 // strings below to the corresponding UI code, in order to prevent | 203 // strings below to the corresponding UI code, in order to prevent |
| 203 // unnecessary UTF-8 string conversions. | 204 // unnecessary UTF-8 string conversions. |
| 204 | 205 |
| 205 // Details about the website's identity. If the website's identity has been | 206 // Details about the website's identity. If the website's identity has been |
| 206 // verified then |site_identity_details_| contains who verified the identity. | 207 // verified then |site_identity_details_| contains who verified the identity. |
| (...skipping 12 matching lines...) Expand all Loading... |
| 219 // encryption strength and ssl protocol version. This string will be | 220 // encryption strength and ssl protocol version. This string will be |
| 220 // displayed in the UI. | 221 // displayed in the UI. |
| 221 base::string16 site_connection_details_; | 222 base::string16 site_connection_details_; |
| 222 | 223 |
| 223 // For websites that provided an EV certificate |orgainization_name_| | 224 // For websites that provided an EV certificate |orgainization_name_| |
| 224 // contains the organization name of the certificate. In all other cases | 225 // contains the organization name of the certificate. In all other cases |
| 225 // |organization_name| is an empty string. This string will be displayed in | 226 // |organization_name| is an empty string. This string will be displayed in |
| 226 // the UI. | 227 // the UI. |
| 227 base::string16 organization_name_; | 228 base::string16 organization_name_; |
| 228 | 229 |
| 229 // The |CertStore| provides all X509Certificates. | |
| 230 content::CertStore* cert_store_; | |
| 231 | |
| 232 // The |HostContentSettingsMap| is the service that provides and manages | 230 // The |HostContentSettingsMap| is the service that provides and manages |
| 233 // content settings (aka. site permissions). | 231 // content settings (aka. site permissions). |
| 234 HostContentSettingsMap* content_settings_; | 232 HostContentSettingsMap* content_settings_; |
| 235 | 233 |
| 236 // Service for managing SSL error page bypasses. Used to revoke bypass | 234 // Service for managing SSL error page bypasses. Used to revoke bypass |
| 237 // decisions by users. | 235 // decisions by users. |
| 238 ChromeSSLHostStateDelegate* chrome_ssl_host_state_delegate_; | 236 ChromeSSLHostStateDelegate* chrome_ssl_host_state_delegate_; |
| 239 | 237 |
| 240 bool did_revoke_user_ssl_decisions_; | 238 bool did_revoke_user_ssl_decisions_; |
| 241 | 239 |
| 242 Profile* profile_; | 240 Profile* profile_; |
| 243 | 241 |
| 244 DISALLOW_COPY_AND_ASSIGN(WebsiteSettings); | 242 DISALLOW_COPY_AND_ASSIGN(WebsiteSettings); |
| 245 }; | 243 }; |
| 246 | 244 |
| 247 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_ | 245 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_ |
| OLD | NEW |