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_WEBSITE_SETTINGS_MODEL_H_ | 5 #ifndef CHROME_BROWSER_WEBSITE_SETTINGS_MODEL_H_ |
6 #define CHROME_BROWSER_WEBSITE_SETTINGS_MODEL_H_ | 6 #define CHROME_BROWSER_WEBSITE_SETTINGS_MODEL_H_ |
7 | 7 |
8 #include "base/string16.h" | 8 #include "base/string16.h" |
9 #include "googleurl/src/gurl.h" | 9 #include "googleurl/src/gurl.h" |
10 | 10 |
| 11 // --- |
| 12 |
| 13 #include "chrome/browser/browsing_data_cookie_helper.h" |
| 14 #include "chrome/browser/browsing_data_appcache_helper.h" |
| 15 #include "chrome/browser/browsing_data_database_helper.h" |
| 16 #include "chrome/browser/browsing_data_file_system_helper.h" |
| 17 #include "chrome/browser/browsing_data_indexed_db_helper.h" |
| 18 #include "chrome/browser/browsing_data_local_storage_helper.h" |
| 19 #include "chrome/browser/ui/website_settings_popup.h" |
| 20 #include "net/cookies/cookie_monster.h" |
| 21 |
11 namespace content { | 22 namespace content { |
12 class CertStore; | 23 class CertStore; |
13 struct SSLStatus; | 24 struct SSLStatus; |
14 } | 25 } |
15 | 26 |
| 27 class HostContentSettingsMap; |
16 class Profile; | 28 class Profile; |
| 29 class SiteData; |
17 class TabContentsWrapper; | 30 class TabContentsWrapper; |
| 31 class TabSpecificContentSettings; |
18 | 32 |
19 // The |WebsiteSettingsModel| provides information about the connection and the | 33 // The |WebsiteSettingsModel| provides information about the connection and the |
20 // identity of a website. The |WebsiteSettingsModel| is the backend for the | 34 // identity of a website. The |WebsiteSettingsModel| is the backend for the |
21 // WebsiteSettingsUI which displays this information. | 35 // WebsiteSettingsUI which displays this information. |
22 class WebsiteSettingsModel { | 36 class WebsiteSettingsModel { |
23 public: | 37 public: |
24 // Status of a connection to a website. | 38 // Status of a connection to a website. |
25 enum SiteConnectionStatus { | 39 enum SiteConnectionStatus { |
26 SITE_CONNECTION_STATUS_UNKNOWN = 0, // No status available. | 40 SITE_CONNECTION_STATUS_UNKNOWN = 0, // No status available. |
27 SITE_CONNECTION_STATUS_ENCRYPTED, // Connection is encrypted. | 41 SITE_CONNECTION_STATUS_ENCRYPTED, // Connection is encrypted. |
28 SITE_CONNECTION_STATUS_MIXED_CONTENT, // Site has unencrypted content. | 42 SITE_CONNECTION_STATUS_MIXED_CONTENT, // Site has unencrypted content. |
29 SITE_CONNECTION_STATUS_UNENCRYPTED, // Connection is not encrypted. | 43 SITE_CONNECTION_STATUS_UNENCRYPTED, // Connection is not encrypted. |
30 SITE_CONNECTION_STATUS_ENCRYPTED_ERROR, // Connection error occured. | 44 SITE_CONNECTION_STATUS_ENCRYPTED_ERROR, // Connection error occured. |
31 SITE_CONNECTION_STATUS_INTERNAL_PAGE, // Internal site. | 45 SITE_CONNECTION_STATUS_INTERNAL_PAGE, // Internal site. |
32 }; | 46 }; |
(...skipping 15 matching lines...) Expand all Loading... |
48 // certificate. This is the expected state for HTTP connections. | 62 // certificate. This is the expected state for HTTP connections. |
49 SITE_IDENTITY_STATUS_NO_CERT, | 63 SITE_IDENTITY_STATUS_NO_CERT, |
50 // An error occured while verifying the site identity. | 64 // An error occured while verifying the site identity. |
51 SITE_IDENTITY_STATUS_ERROR, | 65 SITE_IDENTITY_STATUS_ERROR, |
52 // The site is a trusted internal chrome page. | 66 // The site is a trusted internal chrome page. |
53 SITE_IDENTITY_STATUS_INTERNAL_PAGE, | 67 SITE_IDENTITY_STATUS_INTERNAL_PAGE, |
54 }; | 68 }; |
55 | 69 |
56 // Creates a WebsiteSettingsModel for the passed |url| using the given |ssl| | 70 // Creates a WebsiteSettingsModel for the passed |url| using the given |ssl| |
57 // status object to determine the status of the site's connection. | 71 // status object to determine the status of the site's connection. |
58 WebsiteSettingsModel(Profile* profile, | 72 WebsiteSettingsModel(WebsiteSettingsUI* ui, |
| 73 Profile* profile, |
59 const GURL& url, | 74 const GURL& url, |
60 const content::SSLStatus& ssl, | 75 const content::SSLStatus& ssl, |
61 content::CertStore* cert_store); | 76 content::CertStore* cert_store, |
| 77 TabSpecificContentSettings* content_settings); |
62 | 78 |
63 virtual ~WebsiteSettingsModel(); | 79 virtual ~WebsiteSettingsModel(); |
64 | 80 |
| 81 void GetCookieInfos(CookieInfoList* cookie_info_list); |
| 82 |
| 83 void GetPermissionInfos(PermissionInfoList* permission_info_list); |
| 84 |
65 // Accessors. | 85 // Accessors. |
66 SiteConnectionStatus site_connection_status() const { | 86 SiteConnectionStatus site_connection_status() const { |
67 return site_connection_status_; | 87 return site_connection_status_; |
68 } | 88 } |
69 | 89 |
70 SiteIdentityStatus site_identity_status() const { | 90 SiteIdentityStatus site_identity_status() const { |
71 return site_identity_status_; | 91 return site_identity_status_; |
72 } | 92 } |
73 | 93 |
74 string16 site_connection_details() const { | 94 string16 site_connection_details() const { |
75 return site_connection_details_; | 95 return site_connection_details_; |
76 } | 96 } |
77 | 97 |
78 string16 site_identity_details() const { | 98 string16 site_identity_details() const { |
79 return site_identity_details_; | 99 return site_identity_details_; |
80 } | 100 } |
81 | 101 |
82 string16 organization_name() const { | 102 string16 organization_name() const { |
83 return organization_name_; | 103 return organization_name_; |
84 } | 104 } |
85 | 105 |
| 106 void OnLocalSharedObjectsUpdated(); |
| 107 |
86 private: | 108 private: |
87 // Initializes the |WebsiteSettingsModel|. | 109 // Initializes the |WebsiteSettingsModel|. |
88 void Init(Profile* profile, | 110 void Init(Profile* profile, |
89 const GURL& url, | 111 const GURL& url, |
90 const content::SSLStatus& ssl); | 112 const content::SSLStatus& ssl); |
91 | 113 |
| 114 WebsiteSettingsUI* ui_; // Weak pointer. This class is owned by the UI. |
| 115 |
| 116 GURL site_url_; |
| 117 |
92 // Status of the website's identity verification check. | 118 // Status of the website's identity verification check. |
93 SiteIdentityStatus site_identity_status_; | 119 SiteIdentityStatus site_identity_status_; |
94 | 120 |
95 // Status of the connection to the website. | 121 // Status of the connection to the website. |
96 SiteConnectionStatus site_connection_status_; | 122 SiteConnectionStatus site_connection_status_; |
97 | 123 |
98 // Details about the website's identity. If the website's identity has been | 124 // Details about the website's identity. If the website's identity has been |
99 // verified then |site_identity_details_| contains who verified the identity. | 125 // verified then |site_identity_details_| contains who verified the identity. |
100 string16 site_identity_details_; | 126 string16 site_identity_details_; |
101 | 127 |
102 // Details about the connection to the website. In case of an encrypted | 128 // Details about the connection to the website. In case of an encrypted |
103 // connection |site_connection_details_| contains encryption details, like | 129 // connection |site_connection_details_| contains encryption details, like |
104 // encryption strength and ssl protocol version. | 130 // encryption strength and ssl protocol version. |
105 string16 site_connection_details_; | 131 string16 site_connection_details_; |
106 | 132 |
107 // For websites that provided an EV certificate |orgainization_name_| contains | 133 // For websites that provided an EV certificate |orgainization_name_| contains |
108 // the organization name of the certificate. In all other cases | 134 // the organization name of the certificate. In all other cases |
109 // |organization_name| is an empty string. | 135 // |organization_name| is an empty string. |
110 string16 organization_name_; | 136 string16 organization_name_; |
111 | 137 |
112 // The |CertStore| provides all X509Certificates. | 138 // The |CertStore| provides all X509Certificates. |
113 content::CertStore* cert_store_; | 139 content::CertStore* cert_store_; |
114 | 140 |
| 141 scoped_ptr<SiteData> site_data_; |
| 142 |
| 143 HostContentSettingsMap* content_settings_; |
| 144 |
115 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsModel); | 145 DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsModel); |
116 }; | 146 }; |
117 | 147 |
118 #endif // CHROME_BROWSER_WEBSITE_SETTINGS_MODEL_H_ | 148 #endif // CHROME_BROWSER_WEBSITE_SETTINGS_MODEL_H_ |
OLD | NEW |