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

Unified Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 2408613002: Replace kPreferHtmlOverPlugins feature checks with PluginUtils::ShouldPreferHtmlOverPlugi… (Closed)
Patch Set: Replace remaining kPreferHtmlOverPlugins feature checks with PluginUtils::ShouldPreferHtmlOverPlugi… Created 4 years, 2 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 side-by-side diff with in-line comments
Download patch
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 2bbd2633dfc14c84beeeedc76b3ec736e51a267a..024b1fe9ea9e9b6693f6b7ef1b8d4daf4700f4e9 100644
--- a/chrome/browser/ui/webui/options/content_settings_handler.cc
+++ b/chrome/browser/ui/webui/options/content_settings_handler.cc
@@ -33,6 +33,7 @@
#include "chrome/browser/permissions/chooser_context_base.h"
#include "chrome/browser/permissions/permission_uma_util.h"
#include "chrome/browser/permissions/permission_util.h"
+#include "chrome/browser/plugins/plugin_utils.h"
#include "chrome/browser/plugins/plugins_field_trial.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser_list.h"
@@ -515,7 +516,9 @@ void ContentSettingsHandler::GetLocalizedValues(
// TODO(tommycli): When the HTML5 By Default feature flag is on, we want to
// display strings that begin with "Ask...", even though the setting remains
// DETECT. Once this feature is finalized, then we migrate the setting to ASK.
- bool is_hbd = base::FeatureList::IsEnabled(features::kPreferHtmlOverPlugins);
+ Profile* profile = Profile::FromWebUI(web_ui());
+ bool is_hbd = PluginUtils::ShouldPreferHtmlOverPlugins(
+ HostContentSettingsMapFactory::GetForProfile(profile));
static OptionsStringResource flash_strings[] = {
{"pluginsDetectImportantContent",
is_hbd ? IDS_FLASH_ASK_RECOMMENDED_RADIO
@@ -738,13 +741,14 @@ void ContentSettingsHandler::OnGetPermissionSettingsCompleted(
void ContentSettingsHandler::UpdateSettingDefaultFromModel(
ContentSettingsType type) {
std::string provider_id;
+ HostContentSettingsMap* host_content_settings_map =
+ HostContentSettingsMapFactory::GetForProfile(GetProfile());
ContentSetting default_setting =
- HostContentSettingsMapFactory::GetForProfile(GetProfile())
- ->GetDefaultContentSetting(type, &provider_id);
+ host_content_settings_map->GetDefaultContentSetting(type, &provider_id);
#if defined(ENABLE_PLUGINS)
- default_setting =
- PluginsFieldTrial::EffectiveContentSetting(type, default_setting);
+ default_setting = PluginsFieldTrial::EffectiveContentSetting(
+ host_content_settings_map, type, default_setting);
#endif
// Camera and microphone default content settings cannot be set by the policy.

Powered by Google App Engine
This is Rietveld 408576698