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

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: Overall code cleanup to request reviewers to PTAL. Created 4 years, 5 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;
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 displaying mixed-content resources in the tab containing the
24 // specified frame. This state is reset to the default of not allowed when the
25 // main frame navigates to a different SiteInstance.
26 void AllowDisplayingOfInsecureContent();
27
28 // Enables running mixed-content resources in the tab containing the specified
29 // frame. This state is reset to the default of not allowed when the main
30 // frame navigates to a different SiteInstance.
31 void AllowRunningOfInsecureContent();
32
33 bool insecure_content_allowed_running() {
34 return insecure_content_allowed_running_;
35 }
36
37 bool insecure_content_allowed_displaying() {
38 return insecure_content_allowed_displaying_;
39 }
40
41 private:
42 friend class content::WebContentsUserData<MixedContentSettings>;
43
44 explicit MixedContentSettings(content::WebContents* tab);
45
46 void DidFinishNavigation(
47 content::NavigationHandle* navigation_handle) override;
48
49 // Members to control mixed-content settings for the tab. They will be reset
50 // on cross-site main frame navigations.
51 content::SiteInstance* insecure_content_site_instance_;
52 bool insecure_content_allowed_running_;
53 bool insecure_content_allowed_displaying_;
54
55 DISALLOW_COPY_AND_ASSIGN(MixedContentSettings);
56 };
57
58 #endif // CHROME_BROWSER_CONTENT_SETTINGS_MIXED_CONTENT_SETTINGS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698