| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "headless/lib/browser/headless_content_browser_client.h" | 5 #include "headless/lib/browser/headless_content_browser_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 #include <unordered_set> | 8 #include <unordered_set> |
| 9 | 9 |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 switches::kUserAgent, | 197 switches::kUserAgent, |
| 198 old_command_line.GetSwitchValueNative(switches::kUserAgent)); | 198 old_command_line.GetSwitchValueNative(switches::kUserAgent)); |
| 199 } | 199 } |
| 200 #if defined(HEADLESS_USE_BREAKPAD) | 200 #if defined(HEADLESS_USE_BREAKPAD) |
| 201 // This flag tells child processes to also turn on crash reporting. | 201 // This flag tells child processes to also turn on crash reporting. |
| 202 if (breakpad::IsCrashReporterEnabled()) | 202 if (breakpad::IsCrashReporterEnabled()) |
| 203 command_line->AppendSwitch(::switches::kEnableCrashReporter); | 203 command_line->AppendSwitch(::switches::kEnableCrashReporter); |
| 204 #endif // defined(HEADLESS_USE_BREAKPAD) | 204 #endif // defined(HEADLESS_USE_BREAKPAD) |
| 205 } | 205 } |
| 206 | 206 |
| 207 void HeadlessContentBrowserClient::AllowCertificateError( |
| 208 content::WebContents* web_contents, |
| 209 int cert_error, |
| 210 const net::SSLInfo& ssl_info, |
| 211 const GURL& request_url, |
| 212 content::ResourceType resource_type, |
| 213 bool overridable, |
| 214 bool strict_enforcement, |
| 215 bool expired_previous_decision, |
| 216 const base::Callback<void(content::CertificateRequestResultType)>& |
| 217 callback) { |
| 218 if (!callback.is_null()) |
| 219 callback.Run(content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY); |
| 220 } |
| 221 |
| 207 void HeadlessContentBrowserClient::ResourceDispatcherHostCreated() { | 222 void HeadlessContentBrowserClient::ResourceDispatcherHostCreated() { |
| 208 resource_dispatcher_host_delegate_.reset( | 223 resource_dispatcher_host_delegate_.reset( |
| 209 new HeadlessResourceDispatcherHostDelegate); | 224 new HeadlessResourceDispatcherHostDelegate); |
| 210 content::ResourceDispatcherHost::Get()->SetDelegate( | 225 content::ResourceDispatcherHost::Get()->SetDelegate( |
| 211 resource_dispatcher_host_delegate_.get()); | 226 resource_dispatcher_host_delegate_.get()); |
| 212 } | 227 } |
| 213 | 228 |
| 214 } // namespace headless | 229 } // namespace headless |
| OLD | NEW |