OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h
" | 5 #include "content/shell/browser/layout_test/layout_test_content_browser_client.h
" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "content/public/browser/browser_context.h" | 8 #include "content/public/browser/browser_context.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "content/public/browser/render_process_host.h" | 10 #include "content/public/browser/render_process_host.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 const MainFunctionParams& parameters) { | 118 const MainFunctionParams& parameters) { |
119 set_browser_main_parts(new LayoutTestBrowserMainParts(parameters)); | 119 set_browser_main_parts(new LayoutTestBrowserMainParts(parameters)); |
120 return shell_browser_main_parts(); | 120 return shell_browser_main_parts(); |
121 } | 121 } |
122 | 122 |
123 PlatformNotificationService* | 123 PlatformNotificationService* |
124 LayoutTestContentBrowserClient::GetPlatformNotificationService() { | 124 LayoutTestContentBrowserClient::GetPlatformNotificationService() { |
125 return layout_test_notification_manager_.get(); | 125 return layout_test_notification_manager_.get(); |
126 } | 126 } |
127 | 127 |
| 128 bool LayoutTestContentBrowserClient::ShouldAllowDisplayingInsecureContent( |
| 129 bool allowed_per_settings, |
| 130 const GURL& resource_url, |
| 131 content::WebContents* web_contents) { |
| 132 const base::DictionaryValue& test_flags = |
| 133 BlinkTestController::Get() |
| 134 ->accumulated_layout_test_runtime_flags_changes(); |
| 135 bool allow_displaying = false; |
| 136 test_flags.GetBoolean("displaying_insecure_content_allowed", |
| 137 &allow_displaying); |
| 138 // Displaying is also allowed when running is allowed. |
| 139 bool allow_running = false; |
| 140 test_flags.GetBoolean("running_insecure_content_allowed", &allow_running); |
| 141 |
| 142 return allowed_per_settings || allow_displaying || allow_running; |
| 143 } |
| 144 |
| 145 bool LayoutTestContentBrowserClient::ShouldAllowRunningInsecureContent( |
| 146 bool allowed_per_settings, |
| 147 const url::Origin& origin, |
| 148 const GURL& resource_url, |
| 149 content::WebContents* web_contents) { |
| 150 const base::DictionaryValue& test_flags = |
| 151 BlinkTestController::Get() |
| 152 ->accumulated_layout_test_runtime_flags_changes(); |
| 153 bool allow_running = false; |
| 154 test_flags.GetBoolean("running_insecure_content_allowed", &allow_running); |
| 155 |
| 156 return allowed_per_settings || allow_running; |
| 157 } |
| 158 |
128 } // namespace content | 159 } // namespace content |
OLD | NEW |