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 } |
| 14 |
| 15 // Controls mixed content related settings for the associated WebContents. |
| 16 class MixedContentSettings |
| 17 : public content::WebContentsObserver, |
| 18 public content::WebContentsUserData<MixedContentSettings> { |
| 19 public: |
| 20 ~MixedContentSettings() override; |
| 21 |
| 22 // Enables running mixed-content resources in the tab containing the specified |
| 23 // frame. This state is reset to the default of not allowed when the main |
| 24 // frame navigates to a different SiteInstance. |
| 25 void AllowRunningOfInsecureContent(); |
| 26 |
| 27 bool insecure_content_allowed_running() { |
| 28 return insecure_content_allowed_running_; |
| 29 } |
| 30 |
| 31 private: |
| 32 friend class content::WebContentsUserData<MixedContentSettings>; |
| 33 |
| 34 explicit MixedContentSettings(content::WebContents* tab); |
| 35 |
| 36 void DidFinishNavigation( |
| 37 content::NavigationHandle* navigation_handle) override; |
| 38 |
| 39 // Members to control mixed-content settings for the tab. They will be reset |
| 40 // on cross-site main frame navigations. |
| 41 content::SiteInstance* insecure_content_site_instance_; |
| 42 bool insecure_content_allowed_running_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(MixedContentSettings); |
| 45 }; |
| 46 |
| 47 #endif // CHROME_BROWSER_CONTENT_SETTINGS_MIXED_CONTENT_SETTINGS_H_ |
OLD | NEW |