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

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

Issue 9691003: Add Content API around CertStore. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix clang Created 8 years, 9 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
« no previous file with comments | « chrome/browser/page_info_model.cc ('k') | chrome/browser/ssl/ssl_error_info.cc » ('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/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/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/renderer_preferences_util.h" 13 #include "chrome/browser/renderer_preferences_util.h"
14 #include "chrome/browser/ssl/ssl_error_info.h" 14 #include "chrome/browser/ssl/ssl_error_info.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/public/browser/cert_store.h"
17 #include "content/public/browser/interstitial_page.h" 17 #include "content/public/browser/interstitial_page.h"
18 #include "content/public/browser/navigation_controller.h" 18 #include "content/public/browser/navigation_controller.h"
19 #include "content/public/browser/navigation_entry.h" 19 #include "content/public/browser/navigation_entry.h"
20 #include "content/public/browser/notification_service.h" 20 #include "content/public/browser/notification_service.h"
21 #include "content/public/browser/notification_types.h" 21 #include "content/public/browser/notification_types.h"
22 #include "content/public/browser/render_process_host.h" 22 #include "content/public/browser/render_process_host.h"
23 #include "content/public/browser/render_view_host.h" 23 #include "content/public/browser/render_view_host.h"
24 #include "content/public/browser/web_contents.h" 24 #include "content/public/browser/web_contents.h"
25 #include "content/public/common/ssl_status.h" 25 #include "content/public/common/ssl_status.h"
26 #include "grit/browser_resources.h" 26 #include "grit/browser_resources.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 strings.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr"); 116 strings.SetString("textdirection", base::i18n::IsRTL() ? "rtl" : "ltr");
117 117
118 base::StringPiece html( 118 base::StringPiece html(
119 ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id)); 119 ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id));
120 120
121 return jstemplate_builder::GetI18nTemplateHtml(html, &strings); 121 return jstemplate_builder::GetI18nTemplateHtml(html, &strings);
122 } 122 }
123 123
124 void SSLBlockingPage::OverrideEntry(NavigationEntry* entry) { 124 void SSLBlockingPage::OverrideEntry(NavigationEntry* entry) {
125 int cert_id = CertStore::GetInstance()->StoreCert( 125 int cert_id = content::CertStore::GetInstance()->StoreCert(
126 ssl_info_.cert, web_contents_->GetRenderProcessHost()->GetID()); 126 ssl_info_.cert, web_contents_->GetRenderProcessHost()->GetID());
127 127
128 entry->GetSSL().security_style = 128 entry->GetSSL().security_style =
129 content::SECURITY_STYLE_AUTHENTICATION_BROKEN; 129 content::SECURITY_STYLE_AUTHENTICATION_BROKEN;
130 entry->GetSSL().cert_id = cert_id; 130 entry->GetSSL().cert_id = cert_id;
131 entry->GetSSL().cert_status = ssl_info_.cert_status; 131 entry->GetSSL().cert_status = ssl_info_.cert_status;
132 entry->GetSSL().security_bits = ssl_info_.security_bits; 132 entry->GetSSL().security_bits = ssl_info_.security_bits;
133 content::NotificationService::current()->Notify( 133 content::NotificationService::current()->Notify(
134 content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED, 134 content::NOTIFICATION_SSL_VISIBLE_STATE_CHANGED,
135 content::Source<NavigationController>(&web_contents_->GetController()), 135 content::Source<NavigationController>(&web_contents_->GetController()),
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 "moreInfo1", "moreInfo2", "moreInfo3", "moreInfo4", "moreInfo5" 191 "moreInfo1", "moreInfo2", "moreInfo3", "moreInfo4", "moreInfo5"
192 }; 192 };
193 int i; 193 int i;
194 for (i = 0; i < static_cast<int>(extra_info.size()); i++) { 194 for (i = 0; i < static_cast<int>(extra_info.size()); i++) {
195 strings->SetString(keys[i], extra_info[i]); 195 strings->SetString(keys[i], extra_info[i]);
196 } 196 }
197 for (; i < 5; i++) { 197 for (; i < 5; i++) {
198 strings->SetString(keys[i], ""); 198 strings->SetString(keys[i], "");
199 } 199 }
200 } 200 }
OLDNEW
« no previous file with comments | « chrome/browser/page_info_model.cc ('k') | chrome/browser/ssl/ssl_error_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698