| 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 6b8ed61c2bcb354abed702d9aa9dbd8b7b8b562f..9634044e119da99a649174ae0643414ed77e1eab 100644
|
| --- a/chrome/browser/ui/webui/options/content_settings_handler.cc
|
| +++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
|
| @@ -762,9 +762,9 @@ void ContentSettingsHandler::InitializePage() {
|
| // TODO(mgiuca): Remove this function and the global setting UI
|
| // (https://crbug.com/610900). Then, delete all the per-site data and remove
|
| // this content setting entirely (https://crbug.com/591896).
|
| - web_ui()->CallJavascriptFunction("ContentSettings.setExclusiveAccessVisible",
|
| - base::FundamentalValue(true),
|
| - base::FundamentalValue(false));
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| + "ContentSettings.setExclusiveAccessVisible", base::FundamentalValue(true),
|
| + base::FundamentalValue(false));
|
| }
|
|
|
| void ContentSettingsHandler::OnContentSettingChanged(
|
| @@ -795,7 +795,7 @@ void ContentSettingsHandler::Observe(
|
| HostContentSettingsMapFactory::GetForProfile(profile);
|
| if (profile->IsOffTheRecord() &&
|
| observer_.IsObserving(settings_map)) {
|
| - web_ui()->CallJavascriptFunction(
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| "ContentSettingsExceptionsArea.OTRProfileDestroyed");
|
| observer_.Remove(settings_map);
|
| }
|
| @@ -877,7 +877,7 @@ void ContentSettingsHandler::UpdateSettingDefaultFromModel(
|
| filter_settings.SetString(
|
| ContentSettingsTypeToGroupName(type) + ".managedBy", provider_id);
|
|
|
| - web_ui()->CallJavascriptFunction(
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| "ContentSettings.setContentFilterSettingsValue", filter_settings);
|
| }
|
|
|
| @@ -903,9 +903,8 @@ void ContentSettingsHandler::UpdateHandlersEnabledRadios() {
|
| base::FundamentalValue handlers_enabled(
|
| GetProtocolHandlerRegistry()->enabled());
|
|
|
| - web_ui()->CallJavascriptFunction(
|
| - "ContentSettings.updateHandlersEnabledRadios",
|
| - handlers_enabled);
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| + "ContentSettings.updateHandlersEnabledRadios", handlers_enabled);
|
| }
|
|
|
| void ContentSettingsHandler::UpdateAllExceptionsViewsFromModel() {
|
| @@ -1009,8 +1008,8 @@ void ContentSettingsHandler::UpdateGeolocationExceptionsView() {
|
|
|
| base::StringValue type_string(
|
| ContentSettingsTypeToGroupName(CONTENT_SETTINGS_TYPE_GEOLOCATION));
|
| - web_ui()->CallJavascriptFunction("ContentSettings.setExceptions",
|
| - type_string, exceptions);
|
| + web_ui()->CallJavascriptFunctionUnsafe("ContentSettings.setExceptions",
|
| + type_string, exceptions);
|
|
|
| // This is mainly here to keep this function ideologically parallel to
|
| // UpdateExceptionsViewFromHostContentSettingsMap().
|
| @@ -1049,8 +1048,8 @@ void ContentSettingsHandler::UpdateNotificationExceptionsView() {
|
|
|
| base::StringValue type_string(
|
| ContentSettingsTypeToGroupName(CONTENT_SETTINGS_TYPE_NOTIFICATIONS));
|
| - web_ui()->CallJavascriptFunction("ContentSettings.setExceptions",
|
| - type_string, exceptions);
|
| + web_ui()->CallJavascriptFunctionUnsafe("ContentSettings.setExceptions",
|
| + type_string, exceptions);
|
|
|
| // This is mainly here to keep this function ideologically parallel to
|
| // UpdateExceptionsViewFromHostContentSettingsMap().
|
| @@ -1118,8 +1117,8 @@ void ContentSettingsHandler::UpdateChooserExceptionsViewFromModel(
|
| base::ListValue exceptions;
|
| GetChooserExceptionsFromProfile(false, chooser_type, &exceptions);
|
| base::StringValue type_string(chooser_type.name);
|
| - web_ui()->CallJavascriptFunction("ContentSettings.setExceptions", type_string,
|
| - exceptions);
|
| + web_ui()->CallJavascriptFunctionUnsafe("ContentSettings.setExceptions",
|
| + type_string, exceptions);
|
|
|
| UpdateOTRChooserExceptionsViewFromModel(chooser_type);
|
| }
|
| @@ -1132,8 +1131,8 @@ void ContentSettingsHandler::UpdateOTRChooserExceptionsViewFromModel(
|
| base::ListValue exceptions;
|
| GetChooserExceptionsFromProfile(true, chooser_type, &exceptions);
|
| base::StringValue type_string(chooser_type.name);
|
| - web_ui()->CallJavascriptFunction("ContentSettings.setOTRExceptions",
|
| - type_string, exceptions);
|
| + web_ui()->CallJavascriptFunctionUnsafe("ContentSettings.setOTRExceptions",
|
| + type_string, exceptions);
|
| }
|
|
|
| void ContentSettingsHandler::UpdateZoomLevelsExceptionsView() {
|
| @@ -1200,8 +1199,8 @@ void ContentSettingsHandler::UpdateZoomLevelsExceptionsView() {
|
| }
|
|
|
| base::StringValue type_string(kZoomContentType);
|
| - web_ui()->CallJavascriptFunction("ContentSettings.setExceptions",
|
| - type_string, zoom_levels_exceptions);
|
| + web_ui()->CallJavascriptFunctionUnsafe("ContentSettings.setExceptions",
|
| + type_string, zoom_levels_exceptions);
|
| }
|
|
|
| void ContentSettingsHandler::UpdateExceptionsViewFromHostContentSettingsMap(
|
| @@ -1210,8 +1209,8 @@ void ContentSettingsHandler::UpdateExceptionsViewFromHostContentSettingsMap(
|
| site_settings::GetExceptionsFromHostContentSettingsMap(
|
| GetContentSettingsMap(), type, web_ui(), &exceptions);
|
| base::StringValue type_string(ContentSettingsTypeToGroupName(type));
|
| - web_ui()->CallJavascriptFunction("ContentSettings.setExceptions", type_string,
|
| - exceptions);
|
| + web_ui()->CallJavascriptFunctionUnsafe("ContentSettings.setExceptions",
|
| + type_string, exceptions);
|
|
|
| UpdateExceptionsViewFromOTRHostContentSettingsMap(type);
|
|
|
| @@ -1240,8 +1239,8 @@ void ContentSettingsHandler::UpdateExceptionsViewFromOTRHostContentSettingsMap(
|
| site_settings::GetExceptionsFromHostContentSettingsMap(
|
| otr_settings_map, type, web_ui(), &exceptions);
|
| base::StringValue type_string(ContentSettingsTypeToGroupName(type));
|
| - web_ui()->CallJavascriptFunction("ContentSettings.setOTRExceptions",
|
| - type_string, exceptions);
|
| + web_ui()->CallJavascriptFunctionUnsafe("ContentSettings.setOTRExceptions",
|
| + type_string, exceptions);
|
| }
|
|
|
| void ContentSettingsHandler::GetChooserExceptionsFromProfile(
|
| @@ -1548,10 +1547,9 @@ void ContentSettingsHandler::CheckExceptionPatternValidity(
|
| ContentSettingsPattern pattern =
|
| ContentSettingsPattern::FromString(pattern_string);
|
|
|
| - web_ui()->CallJavascriptFunction(
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| "ContentSettings.patternValidityCheckComplete",
|
| - base::StringValue(type_string),
|
| - base::StringValue(mode_string),
|
| + base::StringValue(type_string), base::StringValue(mode_string),
|
| base::StringValue(pattern_string),
|
| base::FundamentalValue(pattern.IsValid()));
|
| }
|
| @@ -1628,14 +1626,13 @@ void ContentSettingsHandler::ShowFlashMediaLink(
|
| settings.show_flash_exceptions_link;
|
|
|
| if (show_link != show) {
|
| - web_ui()->CallJavascriptFunction(
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| "ContentSettings.showMediaPepperFlashLink",
|
| - base::StringValue(
|
| - link_type == DEFAULT_SETTING ? "default" : "exceptions"),
|
| - base::StringValue(
|
| - content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC
|
| - ? "mic"
|
| - : "camera"),
|
| + base::StringValue(link_type == DEFAULT_SETTING ? "default"
|
| + : "exceptions"),
|
| + base::StringValue(content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC
|
| + ? "mic"
|
| + : "camera"),
|
| base::FundamentalValue(show));
|
| show_link = show;
|
| }
|
| @@ -1691,7 +1688,7 @@ void ContentSettingsHandler::UpdateMediaDeviceDropdownVisibility(
|
| ContentSettingsType type) {
|
| MediaSettingsInfo::ForOneType& settings = media_settings_->forType(type);
|
|
|
| - web_ui()->CallJavascriptFunction(
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| "ContentSettings.setDevicesMenuVisibility",
|
| base::StringValue(ContentSettingsTypeToGroupName(type)),
|
| base::FundamentalValue(!settings.policy_disable));
|
| @@ -1707,7 +1704,7 @@ void ContentSettingsHandler::UpdateProtectedContentExceptionsButton() {
|
| // Exceptions apply only when the feature is enabled.
|
| PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui()));
|
| bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM);
|
| - web_ui()->CallJavascriptFunction(
|
| + web_ui()->CallJavascriptFunctionUnsafe(
|
| "ContentSettings.enableProtectedContentExceptions",
|
| base::FundamentalValue(enable_exceptions));
|
| }
|
|
|