| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ssl/ssl_blocking_page.h" | 5 #include "chrome/browser/ssl/ssl_blocking_page.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/string_piece.h" | 9 #include "base/string_piece.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "content/public/browser/notification_service.h" | 21 #include "content/public/browser/notification_service.h" |
| 22 #include "content/public/browser/notification_types.h" | 22 #include "content/public/browser/notification_types.h" |
| 23 #include "content/public/browser/render_process_host.h" | 23 #include "content/public/browser/render_process_host.h" |
| 24 #include "content/public/browser/ssl_status.h" | 24 #include "content/public/browser/ssl_status.h" |
| 25 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
| 26 #include "grit/browser_resources.h" | 26 #include "grit/browser_resources.h" |
| 27 #include "grit/generated_resources.h" | 27 #include "grit/generated_resources.h" |
| 28 #include "ui/base/l10n/l10n_util.h" | 28 #include "ui/base/l10n/l10n_util.h" |
| 29 #include "ui/base/resource/resource_bundle.h" | 29 #include "ui/base/resource/resource_bundle.h" |
| 30 | 30 |
| 31 using content::NavigationController; |
| 31 using content::NavigationEntry; | 32 using content::NavigationEntry; |
| 32 | 33 |
| 33 namespace { | 34 namespace { |
| 34 | 35 |
| 35 enum SSLBlockingPageEvent { | 36 enum SSLBlockingPageEvent { |
| 36 SHOW, | 37 SHOW, |
| 37 PROCEED, | 38 PROCEED, |
| 38 DONT_PROCEED, | 39 DONT_PROCEED, |
| 39 UNUSED_ENUM, | 40 UNUSED_ENUM, |
| 40 }; | 41 }; |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 int cert_id = CertStore::GetInstance()->StoreCert( | 118 int cert_id = CertStore::GetInstance()->StoreCert( |
| 118 ssl_info.cert, tab()->GetRenderProcessHost()->GetID()); | 119 ssl_info.cert, tab()->GetRenderProcessHost()->GetID()); |
| 119 | 120 |
| 120 entry->GetSSL().security_style = | 121 entry->GetSSL().security_style = |
| 121 content::SECURITY_STYLE_AUTHENTICATION_BROKEN; | 122 content::SECURITY_STYLE_AUTHENTICATION_BROKEN; |
| 122 entry->GetSSL().cert_id = cert_id; | 123 entry->GetSSL().cert_id = cert_id; |
| 123 entry->GetSSL().cert_status = ssl_info.cert_status; | 124 entry->GetSSL().cert_status = ssl_info.cert_status; |
| 124 entry->GetSSL().security_bits = ssl_info.security_bits; | 125 entry->GetSSL().security_bits = ssl_info.security_bits; |
| 125 content::NotificationService::current()->Notify( | 126 content::NotificationService::current()->Notify( |
| 126 content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED, | 127 content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED, |
| 127 content::Source<content::NavigationController>(&tab()->GetController()), | 128 content::Source<NavigationController>(&tab()->GetController()), |
| 128 content::NotificationService::NoDetails()); | 129 content::NotificationService::NoDetails()); |
| 129 } | 130 } |
| 130 | 131 |
| 131 void SSLBlockingPage::CommandReceived(const std::string& command) { | 132 void SSLBlockingPage::CommandReceived(const std::string& command) { |
| 132 if (command == "1") { | 133 if (command == "1") { |
| 133 Proceed(); | 134 Proceed(); |
| 134 } else { | 135 } else { |
| 135 DontProceed(); | 136 DontProceed(); |
| 136 } | 137 } |
| 137 } | 138 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 "moreInfo1", "moreInfo2", "moreInfo3", "moreInfo4", "moreInfo5" | 181 "moreInfo1", "moreInfo2", "moreInfo3", "moreInfo4", "moreInfo5" |
| 181 }; | 182 }; |
| 182 int i; | 183 int i; |
| 183 for (i = 0; i < static_cast<int>(extra_info.size()); i++) { | 184 for (i = 0; i < static_cast<int>(extra_info.size()); i++) { |
| 184 strings->SetString(keys[i], extra_info[i]); | 185 strings->SetString(keys[i], extra_info[i]); |
| 185 } | 186 } |
| 186 for (; i < 5; i++) { | 187 for (; i < 5; i++) { |
| 187 strings->SetString(keys[i], ""); | 188 strings->SetString(keys[i], ""); |
| 188 } | 189 } |
| 189 } | 190 } |
| OLD | NEW |