| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "chrome/browser/browser_process.h" | 10 #include "chrome/browser/browser_process.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site=%s&clie
nt=googlechrome"; | 31 "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site=%s&clie
nt=googlechrome"; |
| 32 #else | 32 #else |
| 33 static const char* const kSbDiagnosticUrl = | 33 static const char* const kSbDiagnosticUrl = |
| 34 "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site=%s&clie
nt=chromium"; | 34 "http://safebrowsing.clients.google.com/safebrowsing/diagnostic?site=%s&clie
nt=chromium"; |
| 35 #endif | 35 #endif |
| 36 | 36 |
| 37 static const char* const kSbReportPhishingUrl = | 37 static const char* const kSbReportPhishingUrl = |
| 38 "http://www.google.com/safebrowsing/report_error/"; | 38 "http://www.google.com/safebrowsing/report_error/"; |
| 39 | 39 |
| 40 static const wchar_t* const kSbDiagnosticHtml = | 40 static const wchar_t* const kSbDiagnosticHtml = |
| 41 L"<a href=\"\" onClick=\"sendCommand('showDiagnostic'); return false;\" onMo
useDown=\"return false;\">%ls</a>"; | 41 L"<a href=\"\" onClick=\"sendCommand('showDiagnostic'); return false;\" " |
| 42 L"onMouseDown=\"return false;\">%ls</a>"; |
| 42 | 43 |
| 43 // The commands returned by the page when the user performs an action. | 44 // The commands returned by the page when the user performs an action. |
| 44 static const char* const kShowDiagnosticCommand = "showDiagnostic"; | 45 static const char* const kShowDiagnosticCommand = "showDiagnostic"; |
| 45 static const char* const kReportErrorCommand = "reportError"; | 46 static const char* const kReportErrorCommand = "reportError"; |
| 46 static const char* const kLearnMoreCommand = "learnMore"; | 47 static const char* const kLearnMoreCommand = "learnMore"; |
| 47 static const char* const kProceedCommand = "proceed"; | 48 static const char* const kProceedCommand = "proceed"; |
| 48 static const char* const kTakeMeBackCommand = "takeMeBack"; | 49 static const char* const kTakeMeBackCommand = "takeMeBack"; |
| 49 | 50 |
| 50 SafeBrowsingBlockingPage::SafeBrowsingBlockingPage( | 51 SafeBrowsingBlockingPage::SafeBrowsingBlockingPage( |
| 51 SafeBrowsingService* sb_service, | 52 SafeBrowsingService* sb_service, |
| (...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 (*unsafe_resource_map)[web_contents].push_back(unsafe_resource); | 430 (*unsafe_resource_map)[web_contents].push_back(unsafe_resource); |
| 430 } | 431 } |
| 431 | 432 |
| 432 // static | 433 // static |
| 433 bool SafeBrowsingBlockingPage::IsMainPage( | 434 bool SafeBrowsingBlockingPage::IsMainPage( |
| 434 const UnsafeResourceList& unsafe_resources) { | 435 const UnsafeResourceList& unsafe_resources) { |
| 435 return unsafe_resources.size() == 1 && | 436 return unsafe_resources.size() == 1 && |
| 436 unsafe_resources[0].resource_type == ResourceType::MAIN_FRAME; | 437 unsafe_resources[0].resource_type == ResourceType::MAIN_FRAME; |
| 437 } | 438 } |
| 438 | 439 |
| OLD | NEW |