| 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/task/cancelable_task_tracker.h" | 10 #include "base/task/cancelable_task_tracker.h" |
| 11 #include "base/time/time.h" | 11 #include "base/time/time.h" |
| 12 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 12 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
| 13 #include "chrome/browser/history/history_service.h" | 13 #include "chrome/browser/history/history_service.h" |
| 14 #include "chrome/common/content_settings.h" | 14 #include "chrome/common/content_settings.h" |
| 15 #include "components/content_settings/core/common/content_settings_types.h" | 15 #include "components/content_settings/core/common/content_settings_types.h" |
| 16 #include "content/public/common/signed_certificate_timestamp_id_and_status.h" | 16 #include "content/public/common/signed_certificate_timestamp_id_and_status.h" |
| 17 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 18 #include "url/gurl.h" | 18 #include "url/gurl.h" |
| 19 | 19 |
| 20 namespace content { | 20 namespace content { |
| 21 class CertStore; | 21 class CertStore; |
| 22 struct SSLStatus; | 22 struct SSLStatus; |
| 23 } | 23 } |
| 24 | 24 |
| 25 class ChromeSSLHostStateDelegate; |
| 25 class InfoBarService; | 26 class InfoBarService; |
| 26 class HostContentSettingsMap; | 27 class HostContentSettingsMap; |
| 27 class Profile; | 28 class Profile; |
| 28 class WebsiteSettingsUI; | 29 class WebsiteSettingsUI; |
| 29 | 30 |
| 30 // The |WebsiteSettings| provides information about a website's permissions, | 31 // The |WebsiteSettings| provides information about a website's permissions, |
| 31 // connection state and its identity. It owns a UI that displays the | 32 // connection state and its identity. It owns a UI that displays the |
| 32 // information and allows users to change the permissions. |WebsiteSettings| | 33 // information and allows users to change the permissions. |WebsiteSettings| |
| 33 // objects must be created on the heap. They destroy themselves after the UI is | 34 // objects must be created on the heap. They destroy themselves after the UI is |
| 34 // closed. | 35 // closed. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 base::Time first_visit); | 91 base::Time first_visit); |
| 91 | 92 |
| 92 // This method is called by the UI when the UI is closing. | 93 // This method is called by the UI when the UI is closing. |
| 93 void OnUIClosing(); | 94 void OnUIClosing(); |
| 94 | 95 |
| 95 // Accessors. | 96 // Accessors. |
| 96 SiteConnectionStatus site_connection_status() const { | 97 SiteConnectionStatus site_connection_status() const { |
| 97 return site_connection_status_; | 98 return site_connection_status_; |
| 98 } | 99 } |
| 99 | 100 |
| 101 const GURL& site_url() const { return site_url_; } |
| 102 |
| 100 SiteIdentityStatus site_identity_status() const { | 103 SiteIdentityStatus site_identity_status() const { |
| 101 return site_identity_status_; | 104 return site_identity_status_; |
| 102 } | 105 } |
| 103 | 106 |
| 104 base::string16 site_connection_details() const { | 107 base::string16 site_connection_details() const { |
| 105 return site_connection_details_; | 108 return site_connection_details_; |
| 106 } | 109 } |
| 107 | 110 |
| 108 base::string16 site_identity_details() const { | 111 base::string16 site_identity_details() const { |
| 109 return site_identity_details_; | 112 return site_identity_details_; |
| 110 } | 113 } |
| 111 | 114 |
| 112 base::string16 organization_name() const { | 115 base::string16 organization_name() const { |
| 113 return organization_name_; | 116 return organization_name_; |
| 114 } | 117 } |
| 115 | 118 |
| 119 ChromeSSLHostStateDelegate* chrome_ssl_host_state_delegate() { |
| 120 return chrome_ssl_host_state_delegate_; |
| 121 } |
| 122 |
| 116 // SiteDataObserver implementation. | 123 // SiteDataObserver implementation. |
| 117 virtual void OnSiteDataAccessed() OVERRIDE; | 124 virtual void OnSiteDataAccessed() OVERRIDE; |
| 118 | 125 |
| 119 private: | 126 private: |
| 120 // Initializes the |WebsiteSettings|. | 127 // Initializes the |WebsiteSettings|. |
| 121 void Init(Profile* profile, | 128 void Init(Profile* profile, |
| 122 const GURL& url, | 129 const GURL& url, |
| 123 const content::SSLStatus& ssl); | 130 const content::SSLStatus& ssl); |
| 124 | 131 |
| 125 // Sets (presents) the information about the site's permissions in the |ui_|. | 132 // Sets (presents) the information about the site's permissions in the |ui_|. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 | 178 |
| 172 // TODO(markusheintz): Move the creation of all the base::string16 typed UI | 179 // TODO(markusheintz): Move the creation of all the base::string16 typed UI |
| 173 // strings below to the corresponding UI code, in order to prevent | 180 // strings below to the corresponding UI code, in order to prevent |
| 174 // unnecessary UTF-8 string conversions. | 181 // unnecessary UTF-8 string conversions. |
| 175 | 182 |
| 176 // Details about the website's identity. If the website's identity has been | 183 // Details about the website's identity. If the website's identity has been |
| 177 // verified then |site_identity_details_| contains who verified the identity. | 184 // verified then |site_identity_details_| contains who verified the identity. |
| 178 // This string will be displayed in the UI. | 185 // This string will be displayed in the UI. |
| 179 base::string16 site_identity_details_; | 186 base::string16 site_identity_details_; |
| 180 | 187 |
| 188 // Set when the user has explicitly bypassed an SSL error for this host or |
| 189 // explicitly denied it (the latter of which is not currently possible in the |
| 190 // Chrome UI) and has a flag set to remember ssl decisions (explicit flag or |
| 191 // in the experimental group). When |show_ssl_decision_revoke_button| is |
| 192 // true, the connection area of the page info will include an option for the |
| 193 // user to revoke their decision to bypass the SSL error for this host. |
| 194 bool show_ssl_decision_revoke_button_; |
| 195 |
| 181 // Details about the connection to the website. In case of an encrypted | 196 // Details about the connection to the website. In case of an encrypted |
| 182 // connection |site_connection_details_| contains encryption details, like | 197 // connection |site_connection_details_| contains encryption details, like |
| 183 // encryption strength and ssl protocol version. This string will be | 198 // encryption strength and ssl protocol version. This string will be |
| 184 // displayed in the UI. | 199 // displayed in the UI. |
| 185 base::string16 site_connection_details_; | 200 base::string16 site_connection_details_; |
| 186 | 201 |
| 187 // For websites that provided an EV certificate |orgainization_name_| | 202 // For websites that provided an EV certificate |orgainization_name_| |
| 188 // contains the organization name of the certificate. In all other cases | 203 // contains the organization name of the certificate. In all other cases |
| 189 // |organization_name| is an empty string. This string will be displayed in | 204 // |organization_name| is an empty string. This string will be displayed in |
| 190 // the UI. | 205 // the UI. |
| 191 base::string16 organization_name_; | 206 base::string16 organization_name_; |
| 192 | 207 |
| 193 // The |CertStore| provides all X509Certificates. | 208 // The |CertStore| provides all X509Certificates. |
| 194 content::CertStore* cert_store_; | 209 content::CertStore* cert_store_; |
| 195 | 210 |
| 196 // The |HostContentSettingsMap| is the service that provides and manages | 211 // The |HostContentSettingsMap| is the service that provides and manages |
| 197 // content settings (aka. site permissions). | 212 // content settings (aka. site permissions). |
| 198 HostContentSettingsMap* content_settings_; | 213 HostContentSettingsMap* content_settings_; |
| 199 | 214 |
| 200 // Used to request the number of page visits. | 215 // Used to request the number of page visits. |
| 201 base::CancelableTaskTracker visit_count_task_tracker_; | 216 base::CancelableTaskTracker visit_count_task_tracker_; |
| 202 | 217 |
| 218 // Service for managing SSL error page bypasses. Used to revoke bypass |
| 219 // decisions by users. |
| 220 ChromeSSLHostStateDelegate* chrome_ssl_host_state_delegate_; |
| 221 |
| 203 DISALLOW_COPY_AND_ASSIGN(WebsiteSettings); | 222 DISALLOW_COPY_AND_ASSIGN(WebsiteSettings); |
| 204 }; | 223 }; |
| 205 | 224 |
| 206 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_ | 225 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_ |
| OLD | NEW |