Chromium Code Reviews| OLD | NEW |
|---|---|
| (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_ | |
| OLD | NEW |