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

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

Issue 40095: Enable interstitial pages for SSL certificate errors on Linux. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | « no previous file | chrome/browser/tab_contents/interstitial_page.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) 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_blocking_page.h" 5 #include "chrome/browser/ssl/ssl_blocking_page.h"
6 6
7 #include "base/string_piece.h" 7 #include "base/string_piece.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/browser.h" 9 #include "chrome/browser/browser.h"
10 #include "chrome/browser/cert_store.h" 10 #include "chrome/browser/cert_store.h"
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 L"rtl" : L"ltr"); 63 L"rtl" : L"ltr");
64 64
65 static const StringPiece html( 65 static const StringPiece html(
66 ResourceBundle::GetSharedInstance().GetRawDataResource( 66 ResourceBundle::GetSharedInstance().GetRawDataResource(
67 IDR_SSL_ROAD_BLOCK_HTML)); 67 IDR_SSL_ROAD_BLOCK_HTML));
68 68
69 return jstemplate_builder::GetTemplateHtml(html, &strings, "template_root"); 69 return jstemplate_builder::GetTemplateHtml(html, &strings, "template_root");
70 } 70 }
71 71
72 void SSLBlockingPage::UpdateEntry(NavigationEntry* entry) { 72 void SSLBlockingPage::UpdateEntry(NavigationEntry* entry) {
73 #if defined(OS_WIN)
74 DCHECK(tab()->type() == TAB_CONTENTS_WEB); 73 DCHECK(tab()->type() == TAB_CONTENTS_WEB);
75 WebContents* web = tab()->AsWebContents(); 74 WebContents* web = tab()->AsWebContents();
76 const net::SSLInfo& ssl_info = error_->ssl_info(); 75 const net::SSLInfo& ssl_info = error_->ssl_info();
77 int cert_id = CertStore::GetSharedInstance()->StoreCert( 76 int cert_id = CertStore::GetSharedInstance()->StoreCert(
78 ssl_info.cert, web->render_view_host()->process()->host_id()); 77 ssl_info.cert, web->render_view_host()->process()->host_id());
79 78
80 entry->ssl().set_security_style(SECURITY_STYLE_AUTHENTICATION_BROKEN); 79 entry->ssl().set_security_style(SECURITY_STYLE_AUTHENTICATION_BROKEN);
81 entry->ssl().set_cert_id(cert_id); 80 entry->ssl().set_cert_id(cert_id);
82 entry->ssl().set_cert_status(ssl_info.cert_status); 81 entry->ssl().set_cert_status(ssl_info.cert_status);
83 entry->ssl().set_security_bits(ssl_info.security_bits); 82 entry->ssl().set_security_bits(ssl_info.security_bits);
84 NotificationService::current()->Notify( 83 NotificationService::current()->Notify(
85 NotificationType::SSL_STATE_CHANGED, 84 NotificationType::SSL_STATE_CHANGED,
86 Source<NavigationController>(web->controller()), 85 Source<NavigationController>(web->controller()),
87 NotificationService::NoDetails()); 86 NotificationService::NoDetails());
88 #else
89 NOTIMPLEMENTED();
90 #endif
91 } 87 }
92 88
93 void SSLBlockingPage::CommandReceived(const std::string& command) { 89 void SSLBlockingPage::CommandReceived(const std::string& command) {
94 if (command == "1") { 90 if (command == "1") {
95 Proceed(); 91 Proceed();
96 } else { 92 } else {
97 DontProceed(); 93 DontProceed();
98 } 94 }
99 } 95 }
100 96
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 L"moreInfo1", L"moreInfo2", L"moreInfo3", L"moreInfo4", L"moreInfo5" 131 L"moreInfo1", L"moreInfo2", L"moreInfo3", L"moreInfo4", L"moreInfo5"
136 }; 132 };
137 int i; 133 int i;
138 for (i = 0; i < static_cast<int>(extra_info.size()); i++) { 134 for (i = 0; i < static_cast<int>(extra_info.size()); i++) {
139 strings->SetString(keys[i], extra_info[i]); 135 strings->SetString(keys[i], extra_info[i]);
140 } 136 }
141 for (;i < 5; i++) { 137 for (;i < 5; i++) {
142 strings->SetString(keys[i], L""); 138 strings->SetString(keys[i], L"");
143 } 139 }
144 } 140 }
145
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/tab_contents/interstitial_page.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698