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 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 SetReportingPreference(false); | 287 SetReportingPreference(false); |
288 return; | 288 return; |
289 } | 289 } |
290 | 290 |
291 if (command == kLearnMoreCommand) { | 291 if (command == kLearnMoreCommand) { |
292 // User pressed "Learn more". | 292 // User pressed "Learn more". |
293 GURL url; | 293 GURL url; |
294 SBThreatType threat_type = unsafe_resources_[0].threat_type; | 294 SBThreatType threat_type = unsafe_resources_[0].threat_type; |
295 if (threat_type == SB_THREAT_TYPE_URL_MALWARE || | 295 if (threat_type == SB_THREAT_TYPE_URL_MALWARE || |
296 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL) { | 296 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL) { |
297 url = google_util::AppendGoogleLocaleParam(GURL(kLearnMoreMalwareUrl)); | 297 url = GURL(kLearnMoreMalwareUrl); |
298 } else if (threat_type == SB_THREAT_TYPE_URL_PHISHING || | 298 } else if (threat_type == SB_THREAT_TYPE_URL_PHISHING || |
299 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL) { | 299 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL) { |
300 url = google_util::AppendGoogleLocaleParam(GURL(kLearnMorePhishingUrl)); | 300 url = GURL(kLearnMorePhishingUrl); |
301 } else { | 301 } else { |
302 NOTREACHED(); | 302 NOTREACHED(); |
303 } | 303 } |
304 | 304 |
305 OpenURLParams params( | 305 OpenURLParams params( |
306 url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false); | 306 url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false); |
307 web_contents_->OpenURL(params); | 307 web_contents_->OpenURL(params); |
308 return; | 308 return; |
309 } | 309 } |
310 | 310 |
311 if (command == kLearnMoreCommandV2) { | 311 if (command == kLearnMoreCommandV2) { |
312 // User pressed "Learn more". | 312 // User pressed "Learn more". |
313 GURL url; | 313 GURL url; |
314 SBThreatType threat_type = unsafe_resources_[0].threat_type; | 314 SBThreatType threat_type = unsafe_resources_[0].threat_type; |
315 if (threat_type == SB_THREAT_TYPE_URL_MALWARE || | 315 if (threat_type == SB_THREAT_TYPE_URL_MALWARE || |
316 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL) { | 316 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_MALWARE_URL) { |
317 url = google_util::AppendGoogleLocaleParam(GURL(kLearnMoreMalwareUrlV2)); | 317 url = GURL(kLearnMoreMalwareUrlV2); |
318 } else if (threat_type == SB_THREAT_TYPE_URL_PHISHING || | 318 } else if (threat_type == SB_THREAT_TYPE_URL_PHISHING || |
319 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL) { | 319 threat_type == SB_THREAT_TYPE_CLIENT_SIDE_PHISHING_URL) { |
320 url = google_util::AppendGoogleLocaleParam(GURL(kLearnMorePhishingUrlV2)); | 320 url = GURL(kLearnMorePhishingUrlV2); |
321 } else { | 321 } else { |
322 NOTREACHED(); | 322 NOTREACHED(); |
323 } | 323 } |
324 | 324 |
325 OpenURLParams params( | 325 OpenURLParams params( |
326 url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false); | 326 url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_LINK, false); |
327 web_contents_->OpenURL(params); | 327 web_contents_->OpenURL(params); |
328 return; | 328 return; |
329 } | 329 } |
330 | 330 |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1185 strings->SetString("details", std::string()); | 1185 strings->SetString("details", std::string()); |
1186 strings->SetString("confirm_text", std::string()); | 1186 strings->SetString("confirm_text", std::string()); |
1187 strings->SetString(kBoxChecked, std::string()); | 1187 strings->SetString(kBoxChecked, std::string()); |
1188 strings->SetString( | 1188 strings->SetString( |
1189 "report_error", | 1189 "report_error", |
1190 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR)); | 1190 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_PHISHING_V2_REPORT_ERROR)); |
1191 strings->SetBoolean(kDisplayCheckBox, false); | 1191 strings->SetBoolean(kDisplayCheckBox, false); |
1192 strings->SetString("learnMore", | 1192 strings->SetString("learnMore", |
1193 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_LEARN_MORE)); | 1193 l10n_util::GetStringUTF16(IDS_SAFE_BROWSING_MALWARE_V2_LEARN_MORE)); |
1194 } | 1194 } |
OLD | NEW |