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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 #include "net/base/escape.h" | 43 #include "net/base/escape.h" |
44 #include "ui/base/l10n/l10n_util.h" | 44 #include "ui/base/l10n/l10n_util.h" |
45 | 45 |
46 using base::UserMetricsAction; | 46 using base::UserMetricsAction; |
47 using content::BrowserThread; | 47 using content::BrowserThread; |
48 using content::InterstitialPage; | 48 using content::InterstitialPage; |
49 using content::OpenURLParams; | 49 using content::OpenURLParams; |
50 using content::Referrer; | 50 using content::Referrer; |
51 using content::WebContents; | 51 using content::WebContents; |
52 | 52 |
53 namespace safe_browsing { | |
54 | |
53 namespace { | 55 namespace { |
54 | 56 |
55 // For malware interstitial pages, we link the problematic URL to Google's | 57 // For malware interstitial pages, we link the problematic URL to Google's |
56 // diagnostic page. | 58 // diagnostic page. |
57 #if defined(GOOGLE_CHROME_BUILD) | 59 #if defined(GOOGLE_CHROME_BUILD) |
58 const char kSbDiagnosticUrl[] = | 60 const char kSbDiagnosticUrl[] = |
59 "https://www.google.com/safebrowsing/diagnostic?site=%s&client=googlechrome" ; | 61 "https://www.google.com/safebrowsing/diagnostic?site=%s&client=googlechrome" ; |
60 #else | 62 #else |
61 const char kSbDiagnosticUrl[] = | 63 const char kSbDiagnosticUrl[] = |
62 "https://www.google.com/safebrowsing/diagnostic?site=%s&client=chromium"; | 64 "https://www.google.com/safebrowsing/diagnostic?site=%s&client=chromium"; |
(...skipping 20 matching lines...) Expand all Loading... | |
83 const char kEventNameHarmful[] = "harmful_interstitial_"; | 85 const char kEventNameHarmful[] = "harmful_interstitial_"; |
84 const char kEventNamePhishing[] = "phishing_interstitial_"; | 86 const char kEventNamePhishing[] = "phishing_interstitial_"; |
85 const char kEventNameOther[] = "safebrowsing_other_interstitial_"; | 87 const char kEventNameOther[] = "safebrowsing_other_interstitial_"; |
86 | 88 |
87 // Constants for the V4 phishing string upgrades. | 89 // Constants for the V4 phishing string upgrades. |
88 const char kReportPhishingErrorUrl[] = | 90 const char kReportPhishingErrorUrl[] = |
89 "https://www.google.com/safebrowsing/report_error/"; | 91 "https://www.google.com/safebrowsing/report_error/"; |
90 const char kReportPhishingErrorTrial[] = "SafeBrowsingReportPhishingErrorLink"; | 92 const char kReportPhishingErrorTrial[] = "SafeBrowsingReportPhishingErrorLink"; |
91 const char kReportPhishingErrorEnabled[] = "Enabled"; | 93 const char kReportPhishingErrorEnabled[] = "Enabled"; |
92 | 94 |
93 base::LazyInstance<SafeBrowsingBlockingPage::UnsafeResourceMap> | 95 base::LazyInstance<safe_browsing::SafeBrowsingBlockingPage::UnsafeResourceMap> |
mattm
2015/11/12 00:36:05
unnecessary safe_browsing::
vakh (old account. dont use)
2015/11/12 09:27:42
Done.
| |
94 g_unsafe_resource_map = LAZY_INSTANCE_INITIALIZER; | 96 g_unsafe_resource_map = LAZY_INSTANCE_INITIALIZER; |
95 | 97 |
96 } // namespace | 98 } // namespace |
97 | 99 |
98 // static | 100 // static |
99 SafeBrowsingBlockingPageFactory* SafeBrowsingBlockingPage::factory_ = NULL; | 101 SafeBrowsingBlockingPageFactory* SafeBrowsingBlockingPage::factory_ = NULL; |
100 | 102 |
101 // The default SafeBrowsingBlockingPageFactory. Global, made a singleton so we | 103 // The default SafeBrowsingBlockingPageFactory. Global, made a singleton so we |
102 // don't leak it. | 104 // don't leak it. |
103 class SafeBrowsingBlockingPageFactoryImpl | 105 class SafeBrowsingBlockingPageFactoryImpl |
(...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
717 "finalParagraph", l10n_util::GetStringUTF16( | 719 "finalParagraph", l10n_util::GetStringUTF16( |
718 IDS_PHISHING_V4_PROCEED_AND_REPORT_PARAGRAPH)); | 720 IDS_PHISHING_V4_PROCEED_AND_REPORT_PARAGRAPH)); |
719 } else { | 721 } else { |
720 load_time_data->SetString( | 722 load_time_data->SetString( |
721 "finalParagraph", | 723 "finalParagraph", |
722 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); | 724 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); |
723 } | 725 } |
724 | 726 |
725 PopulateExtendedReportingOption(load_time_data); | 727 PopulateExtendedReportingOption(load_time_data); |
726 } | 728 } |
729 | |
730 } // namespace safe_browsing | |
OLD | NEW |