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 } | |
| 14 | |
| 15 // Controls mixed content related settings for the associated WebContents. | |
| 16 class MixedContentSettings | |
|
nasko
2017/01/12 18:32:37
Shouldn't this class name include "Observer", sinc
carlosk
2017/01/21 02:54:58
I added the TabHelper suffix as I think it clarifi
| |
| 17 : public content::WebContentsObserver, | |
| 18 public content::WebContentsUserData<MixedContentSettings> { | |
| 19 public: | |
| 20 ~MixedContentSettings() override; | |
| 21 | |
| 22 // Enables running mixed-content resources in the associated WebContents/tab. | |
| 23 // This state is reset to the default of not allowed when the main frame | |
| 24 // navigates to a different SiteInstance. | |
|
nasko
2017/01/12 18:32:37
Why does the SiteInstance matter?
carlosk
2017/01/21 02:54:58
It does not so I removed it.
It is now better exp
| |
| 25 void AllowRunningOfInsecureContent(); | |
| 26 | |
| 27 bool insecure_content_allowed_running() { | |
|
nasko
2017/01/12 18:32:37
nit: is_running_insecure_content_allowed
carlosk
2017/01/21 02:54:58
Done.
| |
| 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. | |
|
nasko
2017/01/12 18:32:37
Why do they stay the same for same-site navigation
carlosk
2017/01/21 02:54:58
See: https://codereview.chromium.org/1905033002/di
nasko
2017/01/23 22:32:37
Thanks for the pointer. Also the description you'v
| |
| 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 |