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

Side by Side Diff: chrome/browser/plugins/plugin_utils.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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "chrome/browser/plugins/plugin_utils.h" 5 #include "chrome/browser/plugins/plugin_utils.h"
6 6
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/webui/site_settings_helper.h" 10 #include "chrome/browser/ui/webui/site_settings_helper.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 !uses_plugin_specific_setting && 67 !uses_plugin_specific_setting &&
68 info.primary_pattern == ContentSettingsPattern::Wildcard() && 68 info.primary_pattern == ContentSettingsPattern::Wildcard() &&
69 info.secondary_pattern == ContentSettingsPattern::Wildcard(); 69 info.secondary_pattern == ContentSettingsPattern::Wildcard();
70 } 70 }
71 if (is_managed) 71 if (is_managed)
72 *is_managed = info.source == content_settings::SETTING_SOURCE_POLICY; 72 *is_managed = info.source == content_settings::SETTING_SOURCE_POLICY;
73 73
74 // For non-JavaScript treated plugins (Flash): unless the user has explicitly 74 // For non-JavaScript treated plugins (Flash): unless the user has explicitly
75 // ALLOWed plugins, return BLOCK for any non-HTTP and non-FILE origin. 75 // ALLOWed plugins, return BLOCK for any non-HTTP and non-FILE origin.
76 if (!use_javascript_setting && *setting != CONTENT_SETTING_ALLOW && 76 if (!use_javascript_setting && *setting != CONTENT_SETTING_ALLOW &&
77 base::FeatureList::IsEnabled(features::kPreferHtmlOverPlugins) && 77 PluginUtils::ShouldPreferHtmlOverPlugins(host_content_settings_map) &&
78 !main_frame_url.SchemeIsHTTPOrHTTPS() && !main_frame_url.SchemeIsFile()) { 78 !main_frame_url.SchemeIsHTTPOrHTTPS() && !main_frame_url.SchemeIsFile()) {
79 *setting = CONTENT_SETTING_BLOCK; 79 *setting = CONTENT_SETTING_BLOCK;
80 } 80 }
81 } 81 }
82 82
83 } // namespace 83 } // namespace
84 84
85 // static 85 // static
86 void PluginUtils::GetPluginContentSetting( 86 void PluginUtils::GetPluginContentSetting(
87 const HostContentSettingsMap* host_content_settings_map, 87 const HostContentSettingsMap* host_content_settings_map,
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 // policy for the plugin default setting. 125 // policy for the plugin default setting.
126 if (provider_id == site_settings::kPolicyProviderId) 126 if (provider_id == site_settings::kPolicyProviderId)
127 return false; 127 return false;
128 128
129 // TODO(groby): We might also need to disable PreferHtml if there is a 129 // TODO(groby): We might also need to disable PreferHtml if there is a
130 // PluginsAllowedForUrl/PluginsBlockedForUrl policy. Not sure. 130 // PluginsAllowedForUrl/PluginsBlockedForUrl policy. Not sure.
131 131
132 // Fine. No policy interferes. We can haz feature. 132 // Fine. No policy interferes. We can haz feature.
133 return base::FeatureList::IsEnabled(features::kPreferHtmlOverPlugins); 133 return base::FeatureList::IsEnabled(features::kPreferHtmlOverPlugins);
134 } 134 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698