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

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

Issue 600153004: Refactor SafeBrowsing and SSL interstitials to have a type variable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 (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/build_time.h" 7 #include "base/build_time.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/i18n/time_formatting.h" 10 #include "base/i18n/time_formatting.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 411 }
412 412
413 std::string SSLBlockingPage::GetHTMLContents() { 413 std::string SSLBlockingPage::GetHTMLContents() {
414 base::DictionaryValue load_time_data; 414 base::DictionaryValue load_time_data;
415 base::string16 url(ASCIIToUTF16(request_url_.host())); 415 base::string16 url(ASCIIToUTF16(request_url_.host()));
416 if (base::i18n::IsRTL()) 416 if (base::i18n::IsRTL())
417 base::i18n::WrapStringWithLTRFormatting(&url); 417 base::i18n::WrapStringWithLTRFormatting(&url);
418 webui::SetFontAndTextDirection(&load_time_data); 418 webui::SetFontAndTextDirection(&load_time_data);
419 419
420 // Shared values for both the overridable and non-overridable versions. 420 // Shared values for both the overridable and non-overridable versions.
421 load_time_data.SetBoolean("ssl", true); 421 load_time_data.SetString("type", "ssl");
422 load_time_data.SetBoolean("overridable", overridable_); 422 load_time_data.SetBoolean("overridable", overridable_);
423 load_time_data.SetString( 423 load_time_data.SetString(
424 "tabTitle", l10n_util::GetStringUTF16(IDS_SSL_V2_TITLE)); 424 "tabTitle", l10n_util::GetStringUTF16(IDS_SSL_V2_TITLE));
425 load_time_data.SetString( 425 load_time_data.SetString(
426 "heading", l10n_util::GetStringUTF16(IDS_SSL_V2_HEADING)); 426 "heading", l10n_util::GetStringUTF16(IDS_SSL_V2_HEADING));
427 427
428 base::Time now = base::Time::NowFromSystemTime(); 428 base::Time now = base::Time::NowFromSystemTime();
429 bool bad_clock = IsErrorDueToBadClock(now, cert_error_); 429 bool bad_clock = IsErrorDueToBadClock(now, cert_error_);
430 if (bad_clock) { 430 if (bad_clock) {
431 load_time_data.SetString("primaryParagraph", 431 load_time_data.SetString("primaryParagraph",
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 for (; i < 5; i++) { 653 for (; i < 5; i++) {
654 strings->SetString(keys[i], std::string()); 654 strings->SetString(keys[i], std::string());
655 } 655 }
656 } 656 }
657 657
658 void SSLBlockingPage::OnGotHistoryCount(bool success, 658 void SSLBlockingPage::OnGotHistoryCount(bool success,
659 int num_visits, 659 int num_visits,
660 base::Time first_visit) { 660 base::Time first_visit) {
661 num_visits_ = num_visits; 661 num_visits_ = num_visits;
662 } 662 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698