| 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 "app/l10n_util.h" |
| 9 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| 10 #include "base/histogram.h" | 11 #include "base/histogram.h" |
| 11 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 12 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
| 13 #include "chrome/browser/dom_operation_notification_details.h" | 14 #include "chrome/browser/dom_operation_notification_details.h" |
| 14 #include "chrome/browser/dom_ui/new_tab_ui.h" | 15 #include "chrome/browser/dom_ui/new_tab_ui.h" |
| 15 #include "chrome/browser/google_util.h" | 16 #include "chrome/browser/google_util.h" |
| 16 #include "chrome/browser/safe_browsing/safe_browsing_service.h" | 17 #include "chrome/browser/safe_browsing/safe_browsing_service.h" |
| 17 #include "chrome/browser/tab_contents/navigation_controller.h" | 18 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 18 #include "chrome/browser/tab_contents/navigation_entry.h" | 19 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 19 #include "chrome/browser/tab_contents/tab_util.h" | 20 #include "chrome/browser/tab_contents/tab_util.h" |
| 20 #include "chrome/browser/tab_contents/tab_contents.h" | 21 #include "chrome/browser/tab_contents/tab_contents.h" |
| 21 #include "chrome/common/jstemplate_builder.h" | 22 #include "chrome/common/jstemplate_builder.h" |
| 22 #include "chrome/common/l10n_util.h" | |
| 23 #include "chrome/common/url_constants.h" | 23 #include "chrome/common/url_constants.h" |
| 24 #include "grit/browser_resources.h" | 24 #include "grit/browser_resources.h" |
| 25 #include "grit/generated_resources.h" | 25 #include "grit/generated_resources.h" |
| 26 #include "grit/locale_settings.h" | 26 #include "grit/locale_settings.h" |
| 27 #include "net/base/escape.h" | 27 #include "net/base/escape.h" |
| 28 | 28 |
| 29 // For malware interstitial pages, we link the problematic URL to Google's | 29 // For malware interstitial pages, we link the problematic URL to Google's |
| 30 // diagnostic page. | 30 // diagnostic page. |
| 31 #if defined(GOOGLE_CHROME_BUILD) | 31 #if defined(GOOGLE_CHROME_BUILD) |
| 32 static const char* const kSbDiagnosticUrl = | 32 static const char* const kSbDiagnosticUrl = |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 481 UnsafeResourceMap* unsafe_resource_map = GetUnsafeResourcesMap(); | 481 UnsafeResourceMap* unsafe_resource_map = GetUnsafeResourcesMap(); |
| 482 (*unsafe_resource_map)[tab_contents].push_back(unsafe_resource); | 482 (*unsafe_resource_map)[tab_contents].push_back(unsafe_resource); |
| 483 } | 483 } |
| 484 | 484 |
| 485 // static | 485 // static |
| 486 bool SafeBrowsingBlockingPage::IsMainPage( | 486 bool SafeBrowsingBlockingPage::IsMainPage( |
| 487 const UnsafeResourceList& unsafe_resources) { | 487 const UnsafeResourceList& unsafe_resources) { |
| 488 return unsafe_resources.size() == 1 && | 488 return unsafe_resources.size() == 1 && |
| 489 unsafe_resources[0].resource_type == ResourceType::MAIN_FRAME; | 489 unsafe_resources[0].resource_type == ResourceType::MAIN_FRAME; |
| 490 } | 490 } |
| OLD | NEW |