| OLD | NEW |
| 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 // Implementation of the SafeBrowsingBlockingPage class. | 5 // Implementation of the SafeBrowsingBlockingPage class. |
| 6 | 6 |
| 7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" | 7 #include "chrome/browser/safe_browsing/safe_browsing_blocking_page.h" |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 if (unsafe_resources_.empty()) { | 764 if (unsafe_resources_.empty()) { |
| 765 NOTREACHED(); | 765 NOTREACHED(); |
| 766 return std::string(); | 766 return std::string(); |
| 767 } | 767 } |
| 768 | 768 |
| 769 DCHECK_GT(unsafe_resources_.size(), 1U); | 769 DCHECK_GT(unsafe_resources_.size(), 1U); |
| 770 PopulateMultipleThreatStringDictionary(&strings); | 770 PopulateMultipleThreatStringDictionary(&strings); |
| 771 html = rb.GetRawDataResource( | 771 html = rb.GetRawDataResource( |
| 772 IDR_SAFE_BROWSING_MULTIPLE_THREAT_BLOCK).as_string(); | 772 IDR_SAFE_BROWSING_MULTIPLE_THREAT_BLOCK).as_string(); |
| 773 interstitial_show_time_ = base::TimeTicks::Now(); | 773 interstitial_show_time_ = base::TimeTicks::Now(); |
| 774 return jstemplate_builder::GetTemplatesHtml(html, &strings, "template_root"); | 774 return webui::GetTemplatesHtml(html, &strings, "template_root"); |
| 775 } | 775 } |
| 776 | 776 |
| 777 void SafeBrowsingBlockingPageV1::PopulateStringDictionary( | 777 void SafeBrowsingBlockingPageV1::PopulateStringDictionary( |
| 778 DictionaryValue* strings, | 778 DictionaryValue* strings, |
| 779 const string16& title, | 779 const string16& title, |
| 780 const string16& headline, | 780 const string16& headline, |
| 781 const string16& description1, | 781 const string16& description1, |
| 782 const string16& description2, | 782 const string16& description2, |
| 783 const string16& description3) { | 783 const string16& description3) { |
| 784 strings->SetString("title", title); | 784 strings->SetString("title", title); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 PopulateMalwareStringDictionary(&strings); | 913 PopulateMalwareStringDictionary(&strings); |
| 914 } else { // Phishing. | 914 } else { // Phishing. |
| 915 DCHECK(threat_type == SB_THREAT_TYPE_URL_PHISHING || | 915 DCHECK(threat_type == SB_THREAT_TYPE_URL_PHISHING || |
| 916 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL); | 916 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL); |
| 917 PopulatePhishingStringDictionary(&strings); | 917 PopulatePhishingStringDictionary(&strings); |
| 918 } | 918 } |
| 919 html = rb.GetRawDataResource(IDR_SAFE_BROWSING_MALWARE_BLOCK_V2). | 919 html = rb.GetRawDataResource(IDR_SAFE_BROWSING_MALWARE_BLOCK_V2). |
| 920 as_string(); | 920 as_string(); |
| 921 } | 921 } |
| 922 interstitial_show_time_ = base::TimeTicks::Now(); | 922 interstitial_show_time_ = base::TimeTicks::Now(); |
| 923 return jstemplate_builder::GetTemplatesHtml(html, &strings, "template-root"); | 923 return webui::GetTemplatesHtml(html, &strings, "template-root"); |
| 924 } | 924 } |
| 925 | 925 |
| 926 void SafeBrowsingBlockingPageV2::PopulateStringDictionary( | 926 void SafeBrowsingBlockingPageV2::PopulateStringDictionary( |
| 927 DictionaryValue* strings, | 927 DictionaryValue* strings, |
| 928 const string16& title, | 928 const string16& title, |
| 929 const string16& headline, | 929 const string16& headline, |
| 930 const string16& description1, | 930 const string16& description1, |
| 931 const string16& description2, | 931 const string16& description2, |
| 932 const string16& description3) { | 932 const string16& description3) { |
| 933 strings->SetString("title", title); | 933 strings->SetString("title", title); |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1043 | 1043 |
| 1044 strings->SetString("details", ""); | 1044 strings->SetString("details", ""); |
| 1045 strings->SetString("confirm_text", ""); | 1045 strings->SetString("confirm_text", ""); |
| 1046 strings->SetString(kBoxChecked, ""); | 1046 strings->SetString(kBoxChecked, ""); |
| 1047 strings->SetString("report_error", | 1047 strings->SetString("report_error", |
| 1048 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR)); | 1048 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR)); |
| 1049 strings->SetBoolean(kDisplayCheckBox, false); | 1049 strings->SetBoolean(kDisplayCheckBox, false); |
| 1050 strings->SetString("learnMore", | 1050 strings->SetString("learnMore", |
| 1051 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_LEARN_MORE)); | 1051 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_LEARN_MORE)); |
| 1052 } | 1052 } |
| OLD | NEW |