Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Side by Side Diff: headless/lib/browser/headless_content_browser_client.cc

Issue 2853763004: added the allowcertificateerror method to the headless browser client so that it can handle certifi… (Closed)
Patch Set: added the allowcertificateerror method to the headless browser client so that it can handle certifi… Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW
« no previous file with comments | « headless/lib/browser/headless_content_browser_client.h ('k') | headless/lib/headless_web_contents_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698