Index: chrome/browser/ui/webui/options/content_settings_handler.cc |
diff --git a/chrome/browser/ui/webui/options/content_settings_handler.cc b/chrome/browser/ui/webui/options/content_settings_handler.cc |
index e98857f9c9c0bdb8713ba965e5d94a789072759b..b812caa0405ea05fa9550037e07b6fb10e8bc64b 100644 |
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc |
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc |
@@ -480,6 +480,7 @@ void ContentSettingsHandler::GetLocalizedValues( |
// Zoom levels. |
{"zoomlevelsHeader", IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL}, |
{"zoomLevelsManage", IDS_ZOOMLEVELS_MANAGE_BUTTON}, |
+ {"zoomLevelsIgnoredExplanation", IDS_ZOOMLEVELS_IGNORED_LABEL}, |
// PDF Plugin filter. |
{"pdfTabLabel", IDS_PDF_TAB_LABEL}, |
{"pdfEnable", IDS_PDF_ENABLE_CHECKBOX}, |
@@ -612,9 +613,18 @@ void ContentSettingsHandler::InitializeHandler() { |
base::Bind(&ContentSettingsHandler::OnZoomLevelChanged, |
base::Unretained(this))); |
+ Profile* profile = Profile::FromWebUI(web_ui()); |
+ |
+ ChromeZoomLevelPrefs* zoom_level_prefs = profile->GetZoomLevelPrefs(); |
+ if (zoom_level_prefs) { |
+ default_zoom_scope_subscription_ = |
+ zoom_level_prefs->RegisterDefaultZoomScopeCallback( |
+ base::Bind(&ContentSettingsHandler::OnZoomScopeChanged, |
+ base::Unretained(this))); |
+ } |
+ |
flash_settings_manager_.reset(new PepperFlashSettingsManager(this, context)); |
- Profile* profile = Profile::FromWebUI(web_ui()); |
observer_.Add(HostContentSettingsMapFactory::GetForProfile(profile)); |
if (profile->HasOffTheRecordProfile()) { |
auto* map = HostContentSettingsMapFactory::GetForProfile( |
@@ -632,6 +642,7 @@ void ContentSettingsHandler::InitializePage() { |
UpdateAllExceptionsViewsFromModel(); |
UpdateAllChooserExceptionsViewsFromModel(); |
UpdateProtectedContentExceptionsButton(); |
+ UpdateZoomScopeExplanationVisibility(); |
} |
void ContentSettingsHandler::OnContentSettingChanged( |
@@ -1404,6 +1415,10 @@ void ContentSettingsHandler::OnZoomLevelChanged( |
UpdateZoomLevelsExceptionsView(); |
} |
+void ContentSettingsHandler::OnZoomScopeChanged() { |
+ UpdateZoomScopeExplanationVisibility(); |
+} |
+ |
void ContentSettingsHandler::ShowFlashMediaLink( |
LinkType link_type, ContentSettingsType content_type, bool show) { |
MediaSettingsInfo::ForOneType& settings = |
@@ -1497,4 +1512,16 @@ void ContentSettingsHandler::UpdateProtectedContentExceptionsButton() { |
base::FundamentalValue(enable_exceptions)); |
} |
+void ContentSettingsHandler::UpdateZoomScopeExplanationVisibility() { |
+ ChromeZoomLevelPrefs* zoom_level_prefs = |
+ Profile::FromWebUI(web_ui())->GetZoomLevelPrefs(); |
+ base::FundamentalValue per_tab_scope( |
+ !(zoom_level_prefs |
+ ? zoom_level_prefs->GetZoomScopeIsPerOriginPref() |
+ : ChromeZoomLevelPrefs::kZoomScopeSettingDefault)); |
+ |
+ web_ui()->CallJavascriptFunctionUnsafe( |
+ "ContentSettings.showZoomScopeExplanation", per_tab_scope); |
+} |
+ |
} // namespace options |