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

Side by Side Diff: chrome/browser/ssl/ssl_blocking_page.cc

Issue 8342048: Make NotificationService an interface in the content namespace, and switch callers to use it. Mov... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | Annotate | Revision Log
OLDNEW
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"
11 #include "base/values.h" 11 #include "base/values.h"
12 #include "chrome/browser/dom_operation_notification_details.h" 12 #include "chrome/browser/dom_operation_notification_details.h"
13 #include "chrome/browser/ssl/ssl_error_info.h" 13 #include "chrome/browser/ssl/ssl_error_info.h"
14 #include "chrome/browser/tab_contents/tab_util.h" 14 #include "chrome/browser/tab_contents/tab_util.h"
15 #include "chrome/common/jstemplate_builder.h" 15 #include "chrome/common/jstemplate_builder.h"
16 #include "content/browser/cert_store.h" 16 #include "content/browser/cert_store.h"
17 #include "content/browser/renderer_host/render_process_host.h" 17 #include "content/browser/renderer_host/render_process_host.h"
18 #include "content/browser/renderer_host/render_view_host.h" 18 #include "content/browser/renderer_host/render_view_host.h"
19 #include "content/browser/ssl/ssl_cert_error_handler.h" 19 #include "content/browser/ssl/ssl_cert_error_handler.h"
20 #include "content/browser/tab_contents/navigation_controller.h" 20 #include "content/browser/tab_contents/navigation_controller.h"
21 #include "content/browser/tab_contents/navigation_entry.h" 21 #include "content/browser/tab_contents/navigation_entry.h"
22 #include "content/browser/tab_contents/tab_contents.h" 22 #include "content/browser/tab_contents/tab_contents.h"
23 #include "content/common/notification_service.h" 23 #include "content/public/browser/notification_service.h"
24 #include "content/public/browser/notification_types.h" 24 #include "content/public/browser/notification_types.h"
25 #include "grit/browser_resources.h" 25 #include "grit/browser_resources.h"
26 #include "grit/generated_resources.h" 26 #include "grit/generated_resources.h"
27 #include "ui/base/l10n/l10n_util.h" 27 #include "ui/base/l10n/l10n_util.h"
28 #include "ui/base/resource/resource_bundle.h" 28 #include "ui/base/resource/resource_bundle.h"
29 29
30 namespace { 30 namespace {
31 31
32 enum SSLBlockingPageEvent { 32 enum SSLBlockingPageEvent {
33 SHOW, 33 SHOW,
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 void SSLBlockingPage::UpdateEntry(NavigationEntry* entry) { 109 void SSLBlockingPage::UpdateEntry(NavigationEntry* entry) {
110 const net::SSLInfo& ssl_info = handler_->ssl_info(); 110 const net::SSLInfo& ssl_info = handler_->ssl_info();
111 int cert_id = CertStore::GetInstance()->StoreCert( 111 int cert_id = CertStore::GetInstance()->StoreCert(
112 ssl_info.cert, tab()->render_view_host()->process()->id()); 112 ssl_info.cert, tab()->render_view_host()->process()->id());
113 113
114 entry->ssl().set_security_style(SECURITY_STYLE_AUTHENTICATION_BROKEN); 114 entry->ssl().set_security_style(SECURITY_STYLE_AUTHENTICATION_BROKEN);
115 entry->ssl().set_cert_id(cert_id); 115 entry->ssl().set_cert_id(cert_id);
116 entry->ssl().set_cert_status(ssl_info.cert_status); 116 entry->ssl().set_cert_status(ssl_info.cert_status);
117 entry->ssl().set_security_bits(ssl_info.security_bits); 117 entry->ssl().set_security_bits(ssl_info.security_bits);
118 NotificationService::current()->Notify( 118 content::NotificationService::current()->Notify(
119 content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED, 119 content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED,
120 content::Source<NavigationController>(&tab()->controller()), 120 content::Source<NavigationController>(&tab()->controller()),
121 NotificationService::NoDetails()); 121 content::NotificationService::NoDetails());
122 } 122 }
123 123
124 void SSLBlockingPage::CommandReceived(const std::string& command) { 124 void SSLBlockingPage::CommandReceived(const std::string& command) {
125 if (command == "1") { 125 if (command == "1") {
126 Proceed(); 126 Proceed();
127 } else { 127 } else {
128 DontProceed(); 128 DontProceed();
129 } 129 }
130 } 130 }
131 131
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 "moreInfo1", "moreInfo2", "moreInfo3", "moreInfo4", "moreInfo5" 173 "moreInfo1", "moreInfo2", "moreInfo3", "moreInfo4", "moreInfo5"
174 }; 174 };
175 int i; 175 int i;
176 for (i = 0; i < static_cast<int>(extra_info.size()); i++) { 176 for (i = 0; i < static_cast<int>(extra_info.size()); i++) {
177 strings->SetString(keys[i], extra_info[i]); 177 strings->SetString(keys[i], extra_info[i]);
178 } 178 }
179 for (; i < 5; i++) { 179 for (; i < 5; i++) {
180 strings->SetString(keys[i], ""); 180 strings->SetString(keys[i], "");
181 } 181 }
182 } 182 }
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_host_impl.cc ('k') | chrome/browser/ssl/ssl_browser_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698