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

Side by Side Diff: chrome/browser/ui/webui/interstitials/interstitial_ui.cc

Issue 2303413002: Simplify security_interstitials::ControllerClient and other related classes (Closed)
Patch Set: Jialiu comments Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/webui/interstitials/interstitial_ui.h" 5 #include "chrome/browser/ui/webui/interstitials/interstitial_ui.h"
6 6
7 #include "base/atomic_sequence_num.h" 7 #include "base/atomic_sequence_num.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 strict_enforcement = strict_enforcement_param == "1"; 145 strict_enforcement = strict_enforcement_param == "1";
146 } 146 }
147 net::SSLInfo ssl_info; 147 net::SSLInfo ssl_info;
148 ssl_info.cert = ssl_info.unverified_cert = CreateFakeCert(); 148 ssl_info.cert = ssl_info.unverified_cert = CreateFakeCert();
149 // This delegate doesn't create an interstitial. 149 // This delegate doesn't create an interstitial.
150 int options_mask = 0; 150 int options_mask = 0;
151 if (overridable) 151 if (overridable)
152 options_mask |= security_interstitials::SSLErrorUI::SOFT_OVERRIDE_ENABLED; 152 options_mask |= security_interstitials::SSLErrorUI::SOFT_OVERRIDE_ENABLED;
153 if (strict_enforcement) 153 if (strict_enforcement)
154 options_mask |= security_interstitials::SSLErrorUI::STRICT_ENFORCEMENT; 154 options_mask |= security_interstitials::SSLErrorUI::STRICT_ENFORCEMENT;
155 return new SSLBlockingPage( 155 return SSLBlockingPage::Create(
156 web_contents, cert_error, ssl_info, request_url, options_mask, 156 web_contents, cert_error, ssl_info, request_url, options_mask,
157 time_triggered_, nullptr, 157 time_triggered_, nullptr,
158 base::Callback<void(content::CertificateRequestResultType)>()); 158 base::Callback<void(content::CertificateRequestResultType)>());
159 } 159 }
160 160
161 BadClockBlockingPage* CreateBadClockBlockingPage( 161 BadClockBlockingPage* CreateBadClockBlockingPage(
162 content::WebContents* web_contents) { 162 content::WebContents* web_contents) {
163 // Set up a fake clock error. 163 // Set up a fake clock error.
164 int cert_error = net::ERR_CERT_DATE_INVALID; 164 int cert_error = net::ERR_CERT_DATE_INVALID;
165 GURL request_url("https://example.com"); 165 GURL request_url("https://example.com");
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 html = interstitial_delegate.get()->GetHTMLContents(); 373 html = interstitial_delegate.get()->GetHTMLContents();
374 } else { 374 } else {
375 html = ResourceBundle::GetSharedInstance() 375 html = ResourceBundle::GetSharedInstance()
376 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_UI_HTML) 376 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_UI_HTML)
377 .as_string(); 377 .as_string();
378 } 378 }
379 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString; 379 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString;
380 html_bytes->data().assign(html.begin(), html.end()); 380 html_bytes->data().assign(html.begin(), html.end());
381 callback.Run(html_bytes.get()); 381 callback.Run(html_bytes.get());
382 } 382 }
OLDNEW
« no previous file with comments | « chrome/browser/ssl/ssl_error_handler.cc ('k') | components/security_interstitials/core/controller_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698