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

Side by Side Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 2264583003: [HBD] Map ASK to DETECT_IMPORTANT_CONTENT when PreferHtmlOverPlugins is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 3 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
« no previous file with comments | « chrome/browser/ui/website_settings/website_settings_ui.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <utility> 10 #include <utility>
(...skipping 14 matching lines...) Expand all
25 #include "chrome/browser/chrome_notification_types.h" 25 #include "chrome/browser/chrome_notification_types.h"
26 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 26 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
27 #include "chrome/browser/content_settings/web_site_settings_uma_util.h" 27 #include "chrome/browser/content_settings/web_site_settings_uma_util.h"
28 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 28 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
29 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 29 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
30 #include "chrome/browser/extensions/extension_special_storage_policy.h" 30 #include "chrome/browser/extensions/extension_special_storage_policy.h"
31 #include "chrome/browser/notifications/desktop_notification_profile_util.h" 31 #include "chrome/browser/notifications/desktop_notification_profile_util.h"
32 #include "chrome/browser/permissions/chooser_context_base.h" 32 #include "chrome/browser/permissions/chooser_context_base.h"
33 #include "chrome/browser/permissions/permission_uma_util.h" 33 #include "chrome/browser/permissions/permission_uma_util.h"
34 #include "chrome/browser/permissions/permission_util.h" 34 #include "chrome/browser/permissions/permission_util.h"
35 #include "chrome/browser/plugins/plugins_field_trial.h"
35 #include "chrome/browser/profiles/profile.h" 36 #include "chrome/browser/profiles/profile.h"
36 #include "chrome/browser/ui/browser_list.h" 37 #include "chrome/browser/ui/browser_list.h"
37 #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" 38 #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
38 #include "chrome/browser/ui/webui/site_settings_helper.h" 39 #include "chrome/browser/ui/webui/site_settings_helper.h"
39 #include "chrome/browser/usb/usb_chooser_context.h" 40 #include "chrome/browser/usb/usb_chooser_context.h"
40 #include "chrome/browser/usb/usb_chooser_context_factory.h" 41 #include "chrome/browser/usb/usb_chooser_context_factory.h"
41 #include "chrome/common/chrome_switches.h" 42 #include "chrome/common/chrome_switches.h"
42 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" 43 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
43 #include "chrome/common/features.h" 44 #include "chrome/common/features.h"
44 #include "chrome/common/pref_names.h" 45 #include "chrome/common/pref_names.h"
45 #include "chrome/common/url_constants.h" 46 #include "chrome/common/url_constants.h"
46 #include "chrome/grit/generated_resources.h" 47 #include "chrome/grit/generated_resources.h"
47 #include "chrome/grit/locale_settings.h" 48 #include "chrome/grit/locale_settings.h"
48 #include "components/content_settings/core/browser/content_settings_details.h" 49 #include "components/content_settings/core/browser/content_settings_details.h"
49 #include "components/content_settings/core/browser/content_settings_utils.h" 50 #include "components/content_settings/core/browser/content_settings_utils.h"
50 #include "components/content_settings/core/browser/host_content_settings_map.h" 51 #include "components/content_settings/core/browser/host_content_settings_map.h"
51 #include "components/content_settings/core/browser/plugins_field_trial.h"
52 #include "components/content_settings/core/browser/website_settings_info.h" 52 #include "components/content_settings/core/browser/website_settings_info.h"
53 #include "components/content_settings/core/browser/website_settings_registry.h" 53 #include "components/content_settings/core/browser/website_settings_registry.h"
54 #include "components/content_settings/core/common/content_settings.h" 54 #include "components/content_settings/core/common/content_settings.h"
55 #include "components/content_settings/core/common/content_settings_pattern.h" 55 #include "components/content_settings/core/common/content_settings_pattern.h"
56 #include "components/google/core/browser/google_util.h" 56 #include "components/google/core/browser/google_util.h"
57 #include "components/prefs/pref_service.h" 57 #include "components/prefs/pref_service.h"
58 #include "components/signin/core/common/profile_management_switches.h" 58 #include "components/signin/core/common/profile_management_switches.h"
59 #include "components/user_prefs/user_prefs.h" 59 #include "components/user_prefs/user_prefs.h"
60 #include "content/public/browser/notification_service.h" 60 #include "content/public/browser/notification_service.h"
61 #include "content/public/browser/notification_source.h" 61 #include "content/public/browser/notification_source.h"
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 722
723 void ContentSettingsHandler::UpdateSettingDefaultFromModel( 723 void ContentSettingsHandler::UpdateSettingDefaultFromModel(
724 ContentSettingsType type) { 724 ContentSettingsType type) {
725 std::string provider_id; 725 std::string provider_id;
726 ContentSetting default_setting = 726 ContentSetting default_setting =
727 HostContentSettingsMapFactory::GetForProfile(GetProfile()) 727 HostContentSettingsMapFactory::GetForProfile(GetProfile())
728 ->GetDefaultContentSetting(type, &provider_id); 728 ->GetDefaultContentSetting(type, &provider_id);
729 729
730 #if defined(ENABLE_PLUGINS) 730 #if defined(ENABLE_PLUGINS)
731 default_setting = 731 default_setting =
732 content_settings::PluginsFieldTrial::EffectiveContentSetting( 732 PluginsFieldTrial::EffectiveContentSetting(type, default_setting);
733 type, default_setting);
734 #endif 733 #endif
735 734
736 // Camera and microphone default content settings cannot be set by the policy. 735 // Camera and microphone default content settings cannot be set by the policy.
737 // However, the policy can disable them. Treat this case visually in the same 736 // However, the policy can disable them. Treat this case visually in the same
738 // way as if the policy set the default setting to BLOCK. Furthermore, compare 737 // way as if the policy set the default setting to BLOCK. Furthermore, compare
739 // the settings with Flash settings and show links to the Flash settings site 738 // the settings with Flash settings and show links to the Flash settings site
740 // if they differ. 739 // if they differ.
741 if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC || 740 if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC ||
742 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) { 741 type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) {
743 UpdateMediaSettingsFromPrefs(type); 742 UpdateMediaSettingsFromPrefs(type);
(...skipping 761 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 1504
1506 // Exceptions apply only when the feature is enabled. 1505 // Exceptions apply only when the feature is enabled.
1507 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); 1506 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui()));
1508 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); 1507 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM);
1509 web_ui()->CallJavascriptFunctionUnsafe( 1508 web_ui()->CallJavascriptFunctionUnsafe(
1510 "ContentSettings.enableProtectedContentExceptions", 1509 "ContentSettings.enableProtectedContentExceptions",
1511 base::FundamentalValue(enable_exceptions)); 1510 base::FundamentalValue(enable_exceptions));
1512 } 1511 }
1513 1512
1514 } // namespace options 1513 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/website_settings/website_settings_ui.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698