Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page.cc

Issue 541103002: Introduce ChromeZoomLevelPref, make zoom level prefs independent of profile prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 17 matching lines...) Expand all
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/common/chrome_switches.h" 31 #include "chrome/common/chrome_switches.h"
32 #include "chrome/common/pref_names.h" 32 #include "chrome/common/pref_names.h"
33 #include "chrome/common/url_constants.h" 33 #include "chrome/common/url_constants.h"
34 #include "chrome/grit/generated_resources.h" 34 #include "chrome/grit/generated_resources.h"
35 #include "chrome/grit/locale_settings.h" 35 #include "chrome/grit/locale_settings.h"
36 #include "components/google/core/browser/google_util.h" 36 #include "components/google/core/browser/google_util.h"
37 #include "content/public/browser/browser_thread.h" 37 #include "content/public/browser/browser_thread.h"
38 #include "content/public/browser/host_zoom_map.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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 } 443 }
442 444
443 NOTREACHED() << "Unexpected command: " << command; 445 NOTREACHED() << "Unexpected command: " << command;
444 } 446 }
445 447
446 void SafeBrowsingBlockingPage::OverrideRendererPrefs( 448 void SafeBrowsingBlockingPage::OverrideRendererPrefs(
447 content::RendererPreferences* prefs) { 449 content::RendererPreferences* prefs) {
448 Profile* profile = Profile::FromBrowserContext( 450 Profile* profile = Profile::FromBrowserContext(
449 web_contents_->GetBrowserContext()); 451 web_contents_->GetBrowserContext());
450 renderer_preferences_util::UpdateFromSystemSettings(prefs, profile); 452 renderer_preferences_util::UpdateFromSystemSettings(prefs, profile);
453 // TODO(wjmaclean): Convert this to use the HostZoomMap for the WebContents
454 // when HostZoomMap moves to StoragePartition.
455 prefs->default_zoom_level = content::HostZoomMap::GetDefaultForBrowserContext(
456 profile)->GetDefaultZoomLevel();
451 } 457 }
452 458
453 void SafeBrowsingBlockingPage::SetReportingPreference(bool report) { 459 void SafeBrowsingBlockingPage::SetReportingPreference(bool report) {
454 Profile* profile = Profile::FromBrowserContext( 460 Profile* profile = Profile::FromBrowserContext(
455 web_contents_->GetBrowserContext()); 461 web_contents_->GetBrowserContext());
456 PrefService* pref = profile->GetPrefs(); 462 PrefService* pref = profile->GetPrefs();
457 pref->SetBoolean(prefs::kSafeBrowsingExtendedReportingEnabled, report); 463 pref->SetBoolean(prefs::kSafeBrowsingExtendedReportingEnabled, report);
458 UMA_HISTOGRAM_BOOLEAN("SB2.SetExtendedReportingEnabled", report); 464 UMA_HISTOGRAM_BOOLEAN("SB2.SetExtendedReportingEnabled", report);
459 } 465 }
460 466
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 IDS_PHISHING_V3_PRIMARY_PARAGRAPH, 946 IDS_PHISHING_V3_PRIMARY_PARAGRAPH,
941 base::UTF8ToUTF16(url_.host()))); 947 base::UTF8ToUTF16(url_.host())));
942 load_time_data->SetString( 948 load_time_data->SetString(
943 "explanationParagraph", 949 "explanationParagraph",
944 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH, 950 l10n_util::GetStringFUTF16(IDS_PHISHING_V3_EXPLANATION_PARAGRAPH,
945 base::UTF8ToUTF16(url_.host()))); 951 base::UTF8ToUTF16(url_.host())));
946 load_time_data->SetString( 952 load_time_data->SetString(
947 "finalParagraph", 953 "finalParagraph",
948 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH)); 954 l10n_util::GetStringUTF16(IDS_PHISHING_V3_PROCEED_PARAGRAPH));
949 } 955 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698