| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_manager.h" | 5 #include "chrome/browser/ssl/ssl_manager.h" |
| 6 | 6 |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/load_from_memory_cache_details.h" | 10 #include "chrome/browser/load_from_memory_cache_details.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/common/l10n_util.h" | 21 #include "chrome/common/l10n_util.h" |
| 22 #include "chrome/common/notification_service.h" | 22 #include "chrome/common/notification_service.h" |
| 23 #include "chrome/common/pref_names.h" | 23 #include "chrome/common/pref_names.h" |
| 24 #include "chrome/common/pref_service.h" | 24 #include "chrome/common/pref_service.h" |
| 25 #include "chrome/common/resource_bundle.h" | 25 #include "chrome/common/resource_bundle.h" |
| 26 #include "grit/generated_resources.h" | 26 #include "grit/generated_resources.h" |
| 27 #include "grit/theme_resources.h" | 27 #include "grit/theme_resources.h" |
| 28 #include "net/base/cert_status_flags.h" | 28 #include "net/base/cert_status_flags.h" |
| 29 #include "net/base/net_errors.h" | 29 #include "net/base/net_errors.h" |
| 30 #include "net/url_request/url_request.h" | 30 #include "net/url_request/url_request.h" |
| 31 #include "third_party/WebKit/WebKit/chromium/public/WebConsoleMessage.h" | |
| 32 #include "webkit/glue/resource_type.h" | 31 #include "webkit/glue/resource_type.h" |
| 33 | 32 |
| 34 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
| 35 // TODO(port): Port these files. | 34 // TODO(port): Port these files. |
| 36 #include "chrome/browser/load_notification_details.h" | 35 #include "chrome/browser/load_notification_details.h" |
| 37 #include "chrome/browser/tab_contents/infobar_delegate.h" | 36 #include "chrome/browser/tab_contents/infobar_delegate.h" |
| 38 #include "chrome/browser/tab_contents/tab_contents.h" | 37 #include "chrome/browser/tab_contents/tab_contents.h" |
| 39 #include "chrome/views/controls/link.h" | 38 #include "chrome/views/controls/link.h" |
| 40 #else | 39 #else |
| 41 #include "chrome/common/temp_scaffolding_stubs.h" | 40 #include "chrome/common/temp_scaffolding_stubs.h" |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 } | 171 } |
| 173 | 172 |
| 174 if (entry->ssl().security_style() > style) { | 173 if (entry->ssl().security_style() > style) { |
| 175 entry->ssl().set_security_style(style); | 174 entry->ssl().set_security_style(style); |
| 176 return true; | 175 return true; |
| 177 } | 176 } |
| 178 return false; | 177 return false; |
| 179 } | 178 } |
| 180 | 179 |
| 181 // Delegate API method. | 180 // Delegate API method. |
| 182 void SSLManager::AddMessageToConsole(const WebConsoleMessage& message) { | 181 void SSLManager::AddMessageToConsole(const string16& message, |
| 182 const WebConsoleMessage::Level& level) { |
| 183 TabContents* tab_contents = controller_->tab_contents(); | 183 TabContents* tab_contents = controller_->tab_contents(); |
| 184 WebContents* web_contents = tab_contents->AsWebContents(); | 184 WebContents* web_contents = tab_contents->AsWebContents(); |
| 185 if (!web_contents) | 185 if (!web_contents) |
| 186 return; | 186 return; |
| 187 | 187 |
| 188 web_contents->render_view_host()->AddMessageToConsole( | 188 web_contents->render_view_host()->AddMessageToConsole( |
| 189 std::wstring(), message); | 189 string16(), message, level); |
| 190 } | 190 } |
| 191 | 191 |
| 192 // Delegate API method. | 192 // Delegate API method. |
| 193 void SSLManager::MarkHostAsBroken(const std::string& host) { | 193 void SSLManager::MarkHostAsBroken(const std::string& host) { |
| 194 ssl_host_state_->MarkHostAsBroken(host); | 194 ssl_host_state_->MarkHostAsBroken(host); |
| 195 DispatchSSLInternalStateChanged(); | 195 DispatchSSLInternalStateChanged(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 // Delegate API method. | 198 // Delegate API method. |
| 199 bool SSLManager::DidMarkHostAsBroken(const std::string& host) const { | 199 bool SSLManager::DidMarkHostAsBroken(const std::string& host) const { |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 } | 749 } |
| 750 | 750 |
| 751 if (ca_name) { | 751 if (ca_name) { |
| 752 // TODO(wtc): should we show the root CA's name instead? | 752 // TODO(wtc): should we show the root CA's name instead? |
| 753 *ca_name = l10n_util::GetStringF( | 753 *ca_name = l10n_util::GetStringF( |
| 754 IDS_SECURE_CONNECTION_EV_CA, | 754 IDS_SECURE_CONNECTION_EV_CA, |
| 755 UTF8ToWide(cert.issuer().organization_names[0])); | 755 UTF8ToWide(cert.issuer().organization_names[0])); |
| 756 } | 756 } |
| 757 return true; | 757 return true; |
| 758 } | 758 } |
| OLD | NEW |