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; | |
26 class InfoBarService; | 25 class InfoBarService; |
27 class HostContentSettingsMap; | 26 class HostContentSettingsMap; |
28 class Profile; | 27 class Profile; |
29 class WebsiteSettingsUI; | 28 class WebsiteSettingsUI; |
30 | 29 |
31 // The |WebsiteSettings| provides information about a website's permissions, | 30 // The |WebsiteSettings| provides information about a website's permissions, |
32 // 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 |
33 // information and allows users to change the permissions. |WebsiteSettings| | 32 // information and allows users to change the permissions. |WebsiteSettings| |
34 // 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 |
35 // closed. | 34 // closed. |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 base::Time first_visit); | 90 base::Time first_visit); |
92 | 91 |
93 // This method is called by the UI when the UI is closing. | 92 // This method is called by the UI when the UI is closing. |
94 void OnUIClosing(); | 93 void OnUIClosing(); |
95 | 94 |
96 // Accessors. | 95 // Accessors. |
97 SiteConnectionStatus site_connection_status() const { | 96 SiteConnectionStatus site_connection_status() const { |
98 return site_connection_status_; | 97 return site_connection_status_; |
99 } | 98 } |
100 | 99 |
101 const GURL& site_url() const { return site_url_; } | |
102 | |
103 SiteIdentityStatus site_identity_status() const { | 100 SiteIdentityStatus site_identity_status() const { |
104 return site_identity_status_; | 101 return site_identity_status_; |
105 } | 102 } |
106 | 103 |
107 base::string16 site_connection_details() const { | 104 base::string16 site_connection_details() const { |
108 return site_connection_details_; | 105 return site_connection_details_; |
109 } | 106 } |
110 | 107 |
111 base::string16 site_identity_details() const { | 108 base::string16 site_identity_details() const { |
112 return site_identity_details_; | 109 return site_identity_details_; |
113 } | 110 } |
114 | 111 |
115 base::string16 organization_name() const { | 112 base::string16 organization_name() const { |
116 return organization_name_; | 113 return organization_name_; |
117 } | 114 } |
118 | 115 |
119 ChromeSSLHostStateDelegate* chrome_ssl_host_state_delegate() { | |
120 return chrome_ssl_host_state_delegate_; | |
121 } | |
122 | |
123 // SiteDataObserver implementation. | 116 // SiteDataObserver implementation. |
124 virtual void OnSiteDataAccessed() OVERRIDE; | 117 virtual void OnSiteDataAccessed() OVERRIDE; |
125 | 118 |
126 private: | 119 private: |
127 // Initializes the |WebsiteSettings|. | 120 // Initializes the |WebsiteSettings|. |
128 void Init(Profile* profile, | 121 void Init(Profile* profile, |
129 const GURL& url, | 122 const GURL& url, |
130 const content::SSLStatus& ssl); | 123 const content::SSLStatus& ssl); |
131 | 124 |
132 // Sets (presents) the information about the site's permissions in the |ui_|. | 125 // 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... |
178 | 171 |
179 // TODO(markusheintz): Move the creation of all the base::string16 typed UI | 172 // TODO(markusheintz): Move the creation of all the base::string16 typed UI |
180 // strings below to the corresponding UI code, in order to prevent | 173 // strings below to the corresponding UI code, in order to prevent |
181 // unnecessary UTF-8 string conversions. | 174 // unnecessary UTF-8 string conversions. |
182 | 175 |
183 // Details about the website's identity. If the website's identity has been | 176 // Details about the website's identity. If the website's identity has been |
184 // verified then |site_identity_details_| contains who verified the identity. | 177 // verified then |site_identity_details_| contains who verified the identity. |
185 // This string will be displayed in the UI. | 178 // This string will be displayed in the UI. |
186 base::string16 site_identity_details_; | 179 base::string16 site_identity_details_; |
187 | 180 |
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 | |
196 // Details about the connection to the website. In case of an encrypted | 181 // Details about the connection to the website. In case of an encrypted |
197 // connection |site_connection_details_| contains encryption details, like | 182 // connection |site_connection_details_| contains encryption details, like |
198 // encryption strength and ssl protocol version. This string will be | 183 // encryption strength and ssl protocol version. This string will be |
199 // displayed in the UI. | 184 // displayed in the UI. |
200 base::string16 site_connection_details_; | 185 base::string16 site_connection_details_; |
201 | 186 |
202 // For websites that provided an EV certificate |orgainization_name_| | 187 // For websites that provided an EV certificate |orgainization_name_| |
203 // contains the organization name of the certificate. In all other cases | 188 // contains the organization name of the certificate. In all other cases |
204 // |organization_name| is an empty string. This string will be displayed in | 189 // |organization_name| is an empty string. This string will be displayed in |
205 // the UI. | 190 // the UI. |
206 base::string16 organization_name_; | 191 base::string16 organization_name_; |
207 | 192 |
208 // The |CertStore| provides all X509Certificates. | 193 // The |CertStore| provides all X509Certificates. |
209 content::CertStore* cert_store_; | 194 content::CertStore* cert_store_; |
210 | 195 |
211 // The |HostContentSettingsMap| is the service that provides and manages | 196 // The |HostContentSettingsMap| is the service that provides and manages |
212 // content settings (aka. site permissions). | 197 // content settings (aka. site permissions). |
213 HostContentSettingsMap* content_settings_; | 198 HostContentSettingsMap* content_settings_; |
214 | 199 |
215 // Used to request the number of page visits. | 200 // Used to request the number of page visits. |
216 base::CancelableTaskTracker visit_count_task_tracker_; | 201 base::CancelableTaskTracker visit_count_task_tracker_; |
217 | 202 |
218 // Service for managing SSL error page bypasses. Used to revoke bypass | |
219 // decisions by users. | |
220 ChromeSSLHostStateDelegate* chrome_ssl_host_state_delegate_; | |
221 | |
222 DISALLOW_COPY_AND_ASSIGN(WebsiteSettings); | 203 DISALLOW_COPY_AND_ASSIGN(WebsiteSettings); |
223 }; | 204 }; |
224 | 205 |
225 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_ | 206 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_ |
OLD | NEW |