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

Side by Side Diff: chrome/browser/content_settings/mixed_content_settings.h

Issue 1905033002: PlzNavigate: Move navigation-level mixed content checks to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-security-message
Patch Set: Addressed all jam@ latest comments. Created 3 years, 11 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
OLDNEW
(Empty)
1 // Copyright (c) 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_CONTENT_SETTINGS_MIXED_CONTENT_SETTINGS_H_
6 #define CHROME_BROWSER_CONTENT_SETTINGS_MIXED_CONTENT_SETTINGS_H_
7
8 #include "content/public/browser/web_contents_observer.h"
9 #include "content/public/browser/web_contents_user_data.h"
10
11 namespace content {
12 class SiteInstance;
13 class NavigationHandle;
jam 2017/01/09 21:15:46 nit: no need to forward declare a parameter to an
carlosk 2017/01/10 19:13:11 Done.
14 }
15
16 // Controls mixed content related settings for the associated WebContents.
17 class MixedContentSettings
18 : public content::WebContentsObserver,
19 public content::WebContentsUserData<MixedContentSettings> {
20 public:
21 ~MixedContentSettings() override;
22
23 // Enables running mixed-content resources in the tab containing the specified
24 // frame. This state is reset to the default of not allowed when the main
25 // frame navigates to a different SiteInstance.
26 void AllowRunningOfInsecureContent();
27
28 bool insecure_content_allowed_running() {
29 return insecure_content_allowed_running_;
30 }
31
32 private:
33 friend class content::WebContentsUserData<MixedContentSettings>;
34
35 explicit MixedContentSettings(content::WebContents* tab);
36
37 void DidFinishNavigation(
38 content::NavigationHandle* navigation_handle) override;
39
40 // Members to control mixed-content settings for the tab. They will be reset
41 // on cross-site main frame navigations.
42 content::SiteInstance* insecure_content_site_instance_;
43 bool insecure_content_allowed_running_;
44
45 DISALLOW_COPY_AND_ASSIGN(MixedContentSettings);
46 };
47
48 #endif // CHROME_BROWSER_CONTENT_SETTINGS_MIXED_CONTENT_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698