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

Side by Side Diff: chrome/browser/ui/website_settings/website_settings.cc

Issue 1341923002: Create a component for SSL error handling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update iOS grit whitelist Created 5 years, 3 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
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/ui/website_settings/website_settings.h" 5 #include "chrome/browser/ui/website_settings/website_settings.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 10 matching lines...) Expand all
21 #include "chrome/browser/browsing_data/browsing_data_database_helper.h" 21 #include "chrome/browser/browsing_data/browsing_data_database_helper.h"
22 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h" 22 #include "chrome/browser/browsing_data/browsing_data_file_system_helper.h"
23 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h" 23 #include "chrome/browser/browsing_data/browsing_data_indexed_db_helper.h"
24 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h" 24 #include "chrome/browser/browsing_data/browsing_data_local_storage_helper.h"
25 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 25 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
26 #include "chrome/browser/history/history_service_factory.h" 26 #include "chrome/browser/history/history_service_factory.h"
27 #include "chrome/browser/infobars/infobar_service.h" 27 #include "chrome/browser/infobars/infobar_service.h"
28 #include "chrome/browser/profiles/profile.h" 28 #include "chrome/browser/profiles/profile.h"
29 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h" 29 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h"
30 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h" 30 #include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h"
31 #include "chrome/browser/ssl/ssl_error_info.h"
32 #include "chrome/browser/ui/website_settings/website_settings_ui.h" 31 #include "chrome/browser/ui/website_settings/website_settings_ui.h"
33 #include "chrome/common/chrome_switches.h" 32 #include "chrome/common/chrome_switches.h"
34 #include "chrome/common/pref_names.h" 33 #include "chrome/common/pref_names.h"
35 #include "chrome/common/url_constants.h" 34 #include "chrome/common/url_constants.h"
36 #include "chrome/grit/chromium_strings.h" 35 #include "chrome/grit/chromium_strings.h"
37 #include "chrome/grit/generated_resources.h" 36 #include "chrome/grit/generated_resources.h"
38 #include "components/content_settings/core/browser/content_settings_utils.h" 37 #include "components/content_settings/core/browser/content_settings_utils.h"
39 #include "components/content_settings/core/browser/host_content_settings_map.h" 38 #include "components/content_settings/core/browser/host_content_settings_map.h"
40 #include "components/content_settings/core/browser/local_shared_objects_counter. h" 39 #include "components/content_settings/core/browser/local_shared_objects_counter. h"
41 #include "components/content_settings/core/common/content_settings.h" 40 #include "components/content_settings/core/common/content_settings.h"
42 #include "components/content_settings/core/common/content_settings_pattern.h" 41 #include "components/content_settings/core/common/content_settings_pattern.h"
43 #include "components/rappor/rappor_utils.h" 42 #include "components/rappor/rappor_utils.h"
43 #include "components/ssl_errors/error_info.h"
44 #include "components/url_formatter/elide_url.h" 44 #include "components/url_formatter/elide_url.h"
45 #include "content/public/browser/browser_thread.h" 45 #include "content/public/browser/browser_thread.h"
46 #include "content/public/browser/cert_store.h" 46 #include "content/public/browser/cert_store.h"
47 #include "content/public/browser/user_metrics.h" 47 #include "content/public/browser/user_metrics.h"
48 #include "content/public/common/content_switches.h" 48 #include "content/public/common/content_switches.h"
49 #include "content/public/common/ssl_status.h" 49 #include "content/public/common/ssl_status.h"
50 #include "content/public/common/url_constants.h" 50 #include "content/public/common/url_constants.h"
51 #include "net/cert/cert_status_flags.h" 51 #include "net/cert/cert_status_flags.h"
52 #include "net/cert/x509_certificate.h" 52 #include "net/cert/x509_certificate.h"
53 #include "net/ssl/ssl_cipher_suite_names.h" 53 #include "net/ssl/ssl_cipher_suite_names.h"
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
480 } else { 480 } else {
481 // HTTP or HTTPS with errors (not warnings). 481 // HTTP or HTTPS with errors (not warnings).
482 site_identity_details_.assign(l10n_util::GetStringUTF16( 482 site_identity_details_.assign(l10n_util::GetStringUTF16(
483 IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY)); 483 IDS_PAGE_INFO_SECURITY_TAB_INSECURE_IDENTITY));
484 if (ssl.security_style == content::SECURITY_STYLE_UNAUTHENTICATED) 484 if (ssl.security_style == content::SECURITY_STYLE_UNAUTHENTICATED)
485 site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT; 485 site_identity_status_ = SITE_IDENTITY_STATUS_NO_CERT;
486 else 486 else
487 site_identity_status_ = SITE_IDENTITY_STATUS_ERROR; 487 site_identity_status_ = SITE_IDENTITY_STATUS_ERROR;
488 488
489 const base::string16 bullet = UTF8ToUTF16("\n • "); 489 const base::string16 bullet = UTF8ToUTF16("\n • ");
490 std::vector<SSLErrorInfo> errors; 490 std::vector<ssl_errors::ErrorInfo> errors;
491 SSLErrorInfo::GetErrorsForCertStatus(ssl.cert_id, ssl.cert_status, 491 ssl_errors::ErrorInfo::GetErrorsForCertStatus(cert, ssl.cert_status, url,
492 url, &errors); 492 &errors);
493 for (size_t i = 0; i < errors.size(); ++i) { 493 for (size_t i = 0; i < errors.size(); ++i) {
494 site_identity_details_ += bullet; 494 site_identity_details_ += bullet;
495 site_identity_details_ += errors[i].short_description(); 495 site_identity_details_ += errors[i].short_description();
496 } 496 }
497 497
498 if (ssl.cert_status & net::CERT_STATUS_NON_UNIQUE_NAME) { 498 if (ssl.cert_status & net::CERT_STATUS_NON_UNIQUE_NAME) {
499 site_identity_details_ += ASCIIToUTF16("\n\n"); 499 site_identity_details_ += ASCIIToUTF16("\n\n");
500 site_identity_details_ += l10n_util::GetStringUTF16( 500 site_identity_details_ += l10n_util::GetStringUTF16(
501 IDS_PAGE_INFO_SECURITY_TAB_NON_UNIQUE_NAME); 501 IDS_PAGE_INFO_SECURITY_TAB_NON_UNIQUE_NAME);
502 } 502 }
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 info.connection_status = site_connection_status_; 732 info.connection_status = site_connection_status_;
733 info.connection_status_description = 733 info.connection_status_description =
734 UTF16ToUTF8(site_connection_details_); 734 UTF16ToUTF8(site_connection_details_);
735 info.identity_status = site_identity_status_; 735 info.identity_status = site_identity_status_;
736 info.identity_status_description = 736 info.identity_status_description =
737 UTF16ToUTF8(site_identity_details_); 737 UTF16ToUTF8(site_identity_details_);
738 info.cert_id = cert_id_; 738 info.cert_id = cert_id_;
739 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_; 739 info.show_ssl_decision_revoke_button = show_ssl_decision_revoke_button_;
740 ui_->SetIdentityInfo(info); 740 ui_->SetIdentityInfo(info);
741 } 741 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698