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 10 matching lines...) Expand all Loading... |
21 #include "base/strings/utf_string_conversions.h" | 21 #include "base/strings/utf_string_conversions.h" |
22 #include "base/time/time.h" | 22 #include "base/time/time.h" |
23 #include "base/values.h" | 23 #include "base/values.h" |
24 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
25 #include "chrome/browser/history/history_service_factory.h" | 25 #include "chrome/browser/history/history_service_factory.h" |
26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
27 #include "chrome/browser/renderer_preferences_util.h" | 27 #include "chrome/browser/renderer_preferences_util.h" |
28 #include "chrome/browser/safe_browsing/malware_details.h" | 28 #include "chrome/browser/safe_browsing/malware_details.h" |
29 #include "chrome/browser/safe_browsing/ui_manager.h" | 29 #include "chrome/browser/safe_browsing/ui_manager.h" |
30 #include "chrome/browser/tab_contents/tab_util.h" | 30 #include "chrome/browser/tab_contents/tab_util.h" |
| 31 #include "chrome/browser/ui/zoom/zoom_controller.h" |
31 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
32 #include "chrome/common/pref_names.h" | 33 #include "chrome/common/pref_names.h" |
33 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" |
34 #include "chrome/grit/generated_resources.h" | 35 #include "chrome/grit/generated_resources.h" |
35 #include "chrome/grit/locale_settings.h" | 36 #include "chrome/grit/locale_settings.h" |
36 #include "components/google/core/browser/google_util.h" | 37 #include "components/google/core/browser/google_util.h" |
37 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
38 #include "content/public/browser/interstitial_page.h" | 39 #include "content/public/browser/interstitial_page.h" |
39 #include "content/public/browser/navigation_controller.h" | 40 #include "content/public/browser/navigation_controller.h" |
40 #include "content/public/browser/user_metrics.h" | 41 #include "content/public/browser/user_metrics.h" |
41 #include "content/public/browser/web_contents.h" | 42 #include "content/public/browser/web_contents.h" |
| 43 #include "content/public/common/renderer_preferences.h" |
42 #include "grit/browser_resources.h" | 44 #include "grit/browser_resources.h" |
43 #include "net/base/escape.h" | 45 #include "net/base/escape.h" |
44 #include "ui/base/l10n/l10n_util.h" | 46 #include "ui/base/l10n/l10n_util.h" |
45 #include "ui/base/resource/resource_bundle.h" | 47 #include "ui/base/resource/resource_bundle.h" |
46 #include "ui/base/webui/jstemplate_builder.h" | 48 #include "ui/base/webui/jstemplate_builder.h" |
47 #include "ui/base/webui/web_ui_util.h" | 49 #include "ui/base/webui/web_ui_util.h" |
48 | 50 |
49 #if defined(ENABLE_EXTENSIONS) | 51 #if defined(ENABLE_EXTENSIONS) |
50 #include "chrome/browser/extensions/api/experience_sampling_private/experience_s
ampling.h" | 52 #include "chrome/browser/extensions/api/experience_sampling_private/experience_s
ampling.h" |
51 #endif | 53 #endif |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 return; | 393 return; |
392 } | 394 } |
393 | 395 |
394 NOTREACHED() << "Unexpected command: " << command; | 396 NOTREACHED() << "Unexpected command: " << command; |
395 } | 397 } |
396 | 398 |
397 void SafeBrowsingBlockingPage::OverrideRendererPrefs( | 399 void SafeBrowsingBlockingPage::OverrideRendererPrefs( |
398 content::RendererPreferences* prefs) { | 400 content::RendererPreferences* prefs) { |
399 Profile* profile = Profile::FromBrowserContext( | 401 Profile* profile = Profile::FromBrowserContext( |
400 web_contents_->GetBrowserContext()); | 402 web_contents_->GetBrowserContext()); |
401 renderer_preferences_util::UpdateFromSystemSettings(prefs, profile); | 403 renderer_preferences_util::UpdateFromSystemSettings( |
| 404 prefs, profile, web_contents_); |
402 } | 405 } |
403 | 406 |
404 void SafeBrowsingBlockingPage::SetReportingPreference(bool report) { | 407 void SafeBrowsingBlockingPage::SetReportingPreference(bool report) { |
405 Profile* profile = Profile::FromBrowserContext( | 408 Profile* profile = Profile::FromBrowserContext( |
406 web_contents_->GetBrowserContext()); | 409 web_contents_->GetBrowserContext()); |
407 PrefService* pref = profile->GetPrefs(); | 410 PrefService* pref = profile->GetPrefs(); |
408 pref->SetBoolean(prefs::kSafeBrowsingExtendedReportingEnabled, report); | 411 pref->SetBoolean(prefs::kSafeBrowsingExtendedReportingEnabled, report); |
409 UMA_HISTOGRAM_BOOLEAN("SB2.SetExtendedReportingEnabled", report); | 412 UMA_HISTOGRAM_BOOLEAN("SB2.SetExtendedReportingEnabled", report); |
410 } | 413 } |
411 | 414 |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 IDS_PHISHING_V3_PRIMARY_PARAGRAPH, | 813 IDS_PHISHING_V3_PRIMARY_PARAGRAPH, |
811 base::UTF8ToUTF16(url_.host()))); | 814 base::UTF8ToUTF16(url_.host()))); |
812 load_time_data->SetString( | 815 load_time_data->SetString( |
813 "explanationParagraph", | 816 "explanationParagraph", |
814 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH, | 817 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH, |
815 base::UTF8ToUTF16(url_.host()))); | 818 base::UTF8ToUTF16(url_.host()))); |
816 load_time_data->SetString( | 819 load_time_data->SetString( |
817 "finalParagraph", | 820 "finalParagraph", |
818 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); | 821 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); |
819 } | 822 } |
OLD | NEW |