OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/browser/ssl/ssl_manager.h" | 5 #include "content/browser/ssl/ssl_manager.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 bool overridable = (options_mask & OVERRIDABLE) != 0; | 349 bool overridable = (options_mask & OVERRIDABLE) != 0; |
350 bool strict_enforcement = (options_mask & STRICT_ENFORCEMENT) != 0; | 350 bool strict_enforcement = (options_mask & STRICT_ENFORCEMENT) != 0; |
351 bool expired_previous_decision = | 351 bool expired_previous_decision = |
352 (options_mask & EXPIRED_PREVIOUS_DECISION) != 0; | 352 (options_mask & EXPIRED_PREVIOUS_DECISION) != 0; |
353 | 353 |
354 WebContents* web_contents = handler->web_contents(); | 354 WebContents* web_contents = handler->web_contents(); |
355 int cert_error = handler->cert_error(); | 355 int cert_error = handler->cert_error(); |
356 const net::SSLInfo& ssl_info = handler->ssl_info(); | 356 const net::SSLInfo& ssl_info = handler->ssl_info(); |
357 const GURL& request_url = handler->request_url(); | 357 const GURL& request_url = handler->request_url(); |
358 ResourceType resource_type = handler->resource_type(); | 358 ResourceType resource_type = handler->resource_type(); |
359 GetContentClient()->browser()->AllowCertificateError( | 359 |
360 web_contents, cert_error, ssl_info, request_url, resource_type, | 360 base::Callback<void(content::CertificateRequestResultType)> callback = |
361 overridable, strict_enforcement, expired_previous_decision, | |
362 base::Bind(&OnAllowCertificate, base::Owned(handler.release()), | 361 base::Bind(&OnAllowCertificate, base::Owned(handler.release()), |
363 ssl_host_state_delegate_)); | 362 ssl_host_state_delegate_); |
| 363 |
| 364 if (!web_contents->NotifyCertificateError(cert_error, request_url, |
| 365 callback)) { |
| 366 GetContentClient()->browser()->AllowCertificateError( |
| 367 web_contents, cert_error, ssl_info, request_url, resource_type, |
| 368 overridable, strict_enforcement, expired_previous_decision, callback); |
| 369 } |
364 } | 370 } |
365 | 371 |
366 void SSLManager::UpdateEntry(NavigationEntryImpl* entry, | 372 void SSLManager::UpdateEntry(NavigationEntryImpl* entry, |
367 int add_content_status_flags, | 373 int add_content_status_flags, |
368 int remove_content_status_flags) { | 374 int remove_content_status_flags) { |
369 // We don't always have a navigation entry to update, for example in the | 375 // We don't always have a navigation entry to update, for example in the |
370 // case of the Web Inspector. | 376 // case of the Web Inspector. |
371 if (!entry) | 377 if (!entry) |
372 return; | 378 return; |
373 | 379 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 SSLManagerSet* managers = | 427 SSLManagerSet* managers = |
422 static_cast<SSLManagerSet*>(context->GetUserData(kSSLManagerKeyName)); | 428 static_cast<SSLManagerSet*>(context->GetUserData(kSSLManagerKeyName)); |
423 | 429 |
424 for (std::set<SSLManager*>::iterator i = managers->get().begin(); | 430 for (std::set<SSLManager*>::iterator i = managers->get().begin(); |
425 i != managers->get().end(); ++i) { | 431 i != managers->get().end(); ++i) { |
426 (*i)->UpdateEntry((*i)->controller()->GetLastCommittedEntry(), 0, 0); | 432 (*i)->UpdateEntry((*i)->controller()->GetLastCommittedEntry(), 0, 0); |
427 } | 433 } |
428 } | 434 } |
429 | 435 |
430 } // namespace content | 436 } // namespace content |
OLD | NEW |