Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(301)

Side by Side Diff: chrome/browser/ui/website_settings/website_settings.h

Issue 2365553002: Fix a use-after-free in WebsiteSettings::OnUIClosing. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/website_settings/website_settings.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "content/public/browser/web_contents_observer.h"
14 #include "url/gurl.h" 15 #include "url/gurl.h"
15 16
16 namespace content { 17 namespace content {
17 class WebContents; 18 class WebContents;
18 } 19 }
19 20
20 namespace net { 21 namespace net {
21 class X509Certificate; 22 class X509Certificate;
22 } 23 }
23 24
24 class ChromeSSLHostStateDelegate; 25 class ChromeSSLHostStateDelegate;
25 class ChooserContextBase; 26 class ChooserContextBase;
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.
35 class WebsiteSettings : public TabSpecificContentSettings::SiteDataObserver { 36 class WebsiteSettings : public TabSpecificContentSettings::SiteDataObserver,
37 public content::WebContentsObserver {
36 public: 38 public:
37 // TODO(palmer): Figure out if it is possible to unify SiteConnectionStatus 39 // TODO(palmer): Figure out if it is possible to unify SiteConnectionStatus
38 // and SiteIdentityStatus. 40 // and SiteIdentityStatus.
39 // 41 //
40 // Status of a connection to a website. 42 // Status of a connection to a website.
41 enum SiteConnectionStatus { 43 enum SiteConnectionStatus {
42 SITE_CONNECTION_STATUS_UNKNOWN = 0, // No status available. 44 SITE_CONNECTION_STATUS_UNKNOWN = 0, // No status available.
43 SITE_CONNECTION_STATUS_ENCRYPTED, // Connection is encrypted. 45 SITE_CONNECTION_STATUS_ENCRYPTED, // Connection is encrypted.
44 SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE, // Non-secure passive 46 SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE, // Non-secure passive
45 // content. 47 // content.
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 // Sets (presents) the information about the site's identity and connection 172 // Sets (presents) the information about the site's identity and connection
171 // in the |ui_|. 173 // in the |ui_|.
172 void PresentSiteIdentity(); 174 void PresentSiteIdentity();
173 175
174 // The website settings UI displays information and controls for site- 176 // The website settings UI displays information and controls for site-
175 // specific data (local stored objects like cookies), site-specific 177 // specific data (local stored objects like cookies), site-specific
176 // permissions (location, pop-up, plugin, etc. permissions) and site-specific 178 // permissions (location, pop-up, plugin, etc. permissions) and site-specific
177 // information (identity, connection status, etc.). 179 // information (identity, connection status, etc.).
178 WebsiteSettingsUI* ui_; 180 WebsiteSettingsUI* ui_;
179 181
180 #if !defined(OS_ANDROID)
181 // The WebContents of the active tab.
182 content::WebContents* web_contents_;
183 #endif
184
185 // The flag that controls whether an infobar is displayed after the website 182 // The flag that controls whether an infobar is displayed after the website
186 // settings UI is closed or not. 183 // settings UI is closed or not.
187 bool show_info_bar_; 184 bool show_info_bar_;
188 185
189 // The Omnibox URL of the website for which to display site permissions and 186 // The Omnibox URL of the website for which to display site permissions and
190 // site information. 187 // site information.
191 GURL site_url_; 188 GURL site_url_;
192 189
193 // Status of the website's identity verification check. 190 // Status of the website's identity verification check.
194 SiteIdentityStatus site_identity_status_; 191 SiteIdentityStatus site_identity_status_;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 ChromeSSLHostStateDelegate* chrome_ssl_host_state_delegate_; 233 ChromeSSLHostStateDelegate* chrome_ssl_host_state_delegate_;
237 234
238 bool did_revoke_user_ssl_decisions_; 235 bool did_revoke_user_ssl_decisions_;
239 236
240 Profile* profile_; 237 Profile* profile_;
241 238
242 DISALLOW_COPY_AND_ASSIGN(WebsiteSettings); 239 DISALLOW_COPY_AND_ASSIGN(WebsiteSettings);
243 }; 240 };
244 241
245 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_ 242 #endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_WEBSITE_SETTINGS_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/website_settings/website_settings.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698