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

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.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 (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 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" 5 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/chrome_notification_types.h" 15 #include "chrome/browser/chrome_notification_types.h"
16 #include "chrome/browser/content_settings/chrome_content_settings_utils.h" 16 #include "chrome/browser/content_settings/chrome_content_settings_utils.h"
17 #include "chrome/browser/content_settings/cookie_settings_factory.h" 17 #include "chrome/browser/content_settings/cookie_settings_factory.h"
18 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 18 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
20 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 20 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
21 #include "chrome/browser/infobars/infobar_service.h" 21 #include "chrome/browser/infobars/infobar_service.h"
22 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" 22 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
23 #include "chrome/browser/permissions/permission_uma_util.h" 23 #include "chrome/browser/permissions/permission_uma_util.h"
24 #include "chrome/browser/permissions/permission_util.h" 24 #include "chrome/browser/permissions/permission_util.h"
25 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" 25 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
26 #include "chrome/browser/plugins/plugin_utils.h"
26 #include "chrome/browser/profiles/profile.h" 27 #include "chrome/browser/profiles/profile.h"
27 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" 28 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h"
28 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" 29 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h"
29 #include "chrome/browser/ui/content_settings/content_setting_bubble_model_delega te.h" 30 #include "chrome/browser/ui/content_settings/content_setting_bubble_model_delega te.h"
30 #include "chrome/common/chrome_features.h" 31 #include "chrome/common/chrome_features.h"
31 #include "chrome/common/chrome_switches.h" 32 #include "chrome/common/chrome_switches.h"
32 #include "chrome/common/pref_names.h" 33 #include "chrome/common/pref_names.h"
33 #include "chrome/common/render_messages.h" 34 #include "chrome/common/render_messages.h"
34 #include "chrome/grit/generated_resources.h" 35 #include "chrome/grit/generated_resources.h"
35 #include "chrome/grit/theme_resources.h" 36 #include "chrome/grit/theme_resources.h"
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 HostContentSettingsMapFactory::GetForProfile(profile()); 196 HostContentSettingsMapFactory::GetForProfile(profile());
196 GURL url = web_contents()->GetURL(); 197 GURL url = web_contents()->GetURL();
197 std::unique_ptr<base::Value> value = map->GetWebsiteSetting( 198 std::unique_ptr<base::Value> value = map->GetWebsiteSetting(
198 url, url, content_type(), std::string(), nullptr); 199 url, url, content_type(), std::string(), nullptr);
199 ContentSetting setting = 200 ContentSetting setting =
200 content_settings::ValueToContentSetting(value.get()); 201 content_settings::ValueToContentSetting(value.get());
201 202
202 // When Flash has been hidden from the plugin list, it is impossible to 203 // When Flash has been hidden from the plugin list, it is impossible to
203 // dynamically load all the plugins on the page. 204 // dynamically load all the plugins on the page.
204 if (setting == CONTENT_SETTING_BLOCK && 205 if (setting == CONTENT_SETTING_BLOCK &&
205 base::FeatureList::IsEnabled(features::kPreferHtmlOverPlugins)) { 206 PluginUtils::ShouldPreferHtmlOverPlugins(map)) {
206 return; 207 return;
207 } 208 }
208 209
209 set_custom_link(l10n_util::GetStringUTF8(IDS_BLOCKED_PLUGINS_LOAD_ALL)); 210 set_custom_link(l10n_util::GetStringUTF8(IDS_BLOCKED_PLUGINS_LOAD_ALL));
210 return; 211 return;
211 } 212 }
212 213
213 static const ContentSettingsTypeIdEntry kCustomIDs[] = { 214 static const ContentSettingsTypeIdEntry kCustomIDs[] = {
214 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_INFO}, 215 {CONTENT_SETTINGS_TYPE_COOKIES, IDS_BLOCKED_COOKIES_INFO},
215 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, IDS_ALLOW_INSECURE_CONTENT_BUTTON}, 216 {CONTENT_SETTINGS_TYPE_MIXEDSCRIPT, IDS_ALLOW_INSECURE_CONTENT_BUTTON},
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
390 391
391 set_setting_is_managed(setting_source != SETTING_SOURCE_USER && 392 set_setting_is_managed(setting_source != SETTING_SOURCE_USER &&
392 setting != CONTENT_SETTING_ASK); 393 setting != CONTENT_SETTING_ASK);
393 394
394 // When Flash has been hidden from the plugin list, it is impossible to 395 // When Flash has been hidden from the plugin list, it is impossible to
395 // dynamically load all the plugins on the page. Then the radio group would 396 // dynamically load all the plugins on the page. Then the radio group would
396 // appear to do nothing. The user must go to Content Settings to enable Flash. 397 // appear to do nothing. The user must go to Content Settings to enable Flash.
397 bool flash_hidden_from_plugin_list = 398 bool flash_hidden_from_plugin_list =
398 content_type() == CONTENT_SETTINGS_TYPE_PLUGINS && 399 content_type() == CONTENT_SETTINGS_TYPE_PLUGINS &&
399 setting == CONTENT_SETTING_BLOCK && 400 setting == CONTENT_SETTING_BLOCK &&
400 base::FeatureList::IsEnabled(features::kPreferHtmlOverPlugins); 401 PluginUtils::ShouldPreferHtmlOverPlugins(
402 HostContentSettingsMapFactory::GetForProfile(profile()));
401 set_radio_group_enabled(setting_source == SETTING_SOURCE_USER && 403 set_radio_group_enabled(setting_source == SETTING_SOURCE_USER &&
402 !flash_hidden_from_plugin_list); 404 !flash_hidden_from_plugin_list);
403 405
404 selected_item_ = radio_group.default_item; 406 selected_item_ = radio_group.default_item;
405 set_radio_group(radio_group); 407 set_radio_group(radio_group);
406 } 408 }
407 409
408 void ContentSettingSingleRadioGroup::SetNarrowestContentSetting( 410 void ContentSettingSingleRadioGroup::SetNarrowestContentSetting(
409 ContentSetting setting) { 411 ContentSetting setting) {
410 if (!profile()) 412 if (!profile())
(...skipping 1055 matching lines...) Expand 10 before | Expand all | Expand 10 after
1466 ContentSettingMediaStreamBubbleModel* 1468 ContentSettingMediaStreamBubbleModel*
1467 ContentSettingBubbleModel::AsMediaStreamBubbleModel() { 1469 ContentSettingBubbleModel::AsMediaStreamBubbleModel() {
1468 // In general, bubble models might not inherit from the media bubble model. 1470 // In general, bubble models might not inherit from the media bubble model.
1469 return nullptr; 1471 return nullptr;
1470 } 1472 }
1471 1473
1472 ContentSettingSubresourceFilterBubbleModel* 1474 ContentSettingSubresourceFilterBubbleModel*
1473 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { 1475 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() {
1474 return nullptr; 1476 return nullptr;
1475 } 1477 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698