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

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: namespaces Created 4 years, 3 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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 strict_enforcement = strict_enforcement_param == "1"; 147 strict_enforcement = strict_enforcement_param == "1";
148 } 148 }
149 net::SSLInfo ssl_info; 149 net::SSLInfo ssl_info;
150 ssl_info.cert = ssl_info.unverified_cert = CreateFakeCert(); 150 ssl_info.cert = ssl_info.unverified_cert = CreateFakeCert();
151 // This delegate doesn't create an interstitial. 151 // This delegate doesn't create an interstitial.
152 int options_mask = 0; 152 int options_mask = 0;
153 if (overridable) 153 if (overridable)
154 options_mask |= security_interstitials::SSLErrorUI::SOFT_OVERRIDE_ENABLED; 154 options_mask |= security_interstitials::SSLErrorUI::SOFT_OVERRIDE_ENABLED;
155 if (strict_enforcement) 155 if (strict_enforcement)
156 options_mask |= security_interstitials::SSLErrorUI::STRICT_ENFORCEMENT; 156 options_mask |= security_interstitials::SSLErrorUI::STRICT_ENFORCEMENT;
157 return new SSLBlockingPage( 157 return SSLBlockingPage::Create(
158 web_contents, cert_error, ssl_info, request_url, options_mask, 158 web_contents, cert_error, ssl_info, request_url, options_mask,
159 time_triggered_, nullptr, 159 time_triggered_, nullptr,
160 base::Callback<void(content::CertificateRequestResultType)>()); 160 base::Callback<void(content::CertificateRequestResultType)>());
161 } 161 }
162 162
163 BadClockBlockingPage* CreateBadClockBlockingPage( 163 BadClockBlockingPage* CreateBadClockBlockingPage(
164 content::WebContents* web_contents) { 164 content::WebContents* web_contents) {
165 // Set up a fake clock error. 165 // Set up a fake clock error.
166 int cert_error = net::ERR_CERT_DATE_INVALID; 166 int cert_error = net::ERR_CERT_DATE_INVALID;
167 GURL request_url("https://example.com"); 167 GURL request_url("https://example.com");
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 html = interstitial_delegate.get()->GetHTMLContents(); 376 html = interstitial_delegate.get()->GetHTMLContents();
377 } else { 377 } else {
378 html = ResourceBundle::GetSharedInstance() 378 html = ResourceBundle::GetSharedInstance()
379 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_UI_HTML) 379 .GetRawDataResource(IDR_SECURITY_INTERSTITIAL_UI_HTML)
380 .as_string(); 380 .as_string();
381 } 381 }
382 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString; 382 scoped_refptr<base::RefCountedString> html_bytes = new base::RefCountedString;
383 html_bytes->data().assign(html.begin(), html.end()); 383 html_bytes->data().assign(html.begin(), html.end());
384 callback.Run(html_bytes.get()); 384 callback.Run(html_bytes.get());
385 } 385 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698