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

Side by Side 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 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/webui/options/content_settings_handler.h" 5 #include "chrome/browser/ui/webui/options/content_settings_handler.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <map> 10 #include <map>
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after
735 &settings.exceptions); 735 &settings.exceptions);
736 736
737 UpdateFlashMediaLinksVisibility(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC); 737 UpdateFlashMediaLinksVisibility(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC);
738 UpdateFlashMediaLinksVisibility(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA); 738 UpdateFlashMediaLinksVisibility(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA);
739 } 739 }
740 } 740 }
741 741
742 void ContentSettingsHandler::UpdateSettingDefaultFromModel( 742 void ContentSettingsHandler::UpdateSettingDefaultFromModel(
743 ContentSettingsType type) { 743 ContentSettingsType type) {
744 std::string provider_id; 744 std::string provider_id;
745 HostContentSettingsMap* host_content_settings_map =
746 HostContentSettingsMapFactory::GetForProfile(GetProfile());
745 ContentSetting default_setting = 747 ContentSetting default_setting =
746 HostContentSettingsMapFactory::GetForProfile(GetProfile()) 748 host_content_settings_map->GetDefaultContentSetting(type, &provider_id);
747 ->GetDefaultContentSetting(type, &provider_id);
748 749
749 #if defined(ENABLE_PLUGINS) 750 #if defined(ENABLE_PLUGINS)
750 default_setting = 751 default_setting = PluginsFieldTrial::EffectiveContentSetting(
751 PluginsFieldTrial::EffectiveContentSetting(type, default_setting); 752 host_content_settings_map, type, default_setting);
752 #endif 753 #endif
753 754
754 // Camera and microphone default content settings cannot be set by the policy. 755 // Camera and microphone default content settings cannot be set by the policy.
755 // However, the policy can disable them. Treat this case visually in the same 756 // However, the policy can disable them. Treat this case visually in the same
756 // way as if the policy set the default setting to BLOCK. Furthermore, compare 757 // way as if the policy set the default setting to BLOCK. Furthermore, compare
757 // the settings with Flash settings and show links to the Flash settings site 758 // the settings with Flash settings and show links to the Flash settings site
758 // if they differ. 759 // if they differ.
759 if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || 760 if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC ||
760 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) { 761 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) {
761 UpdateMediaSettingsFromPrefs(type); 762 UpdateMediaSettingsFromPrefs(type);
(...skipping 760 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 1523
1523 // Exceptions apply only when the feature is enabled. 1524 // Exceptions apply only when the feature is enabled.
1524 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); 1525 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui()));
1525 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); 1526 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM);
1526 web_ui()->CallJavascriptFunctionUnsafe( 1527 web_ui()->CallJavascriptFunctionUnsafe(
1527 "ContentSettings.enableProtectedContentExceptions", 1528 "ContentSettings.enableProtectedContentExceptions",
1528 base::FundamentalValue(enable_exceptions)); 1529 base::FundamentalValue(enable_exceptions));
1529 } 1530 }
1530 1531
1531 } // namespace options 1532 } // namespace options
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698