OLD | NEW |
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 <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
29 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" | 29 #include "chrome/common/extensions/manifest_handlers/app_launch_info.h" |
30 #include "chrome/common/pref_names.h" | 30 #include "chrome/common/pref_names.h" |
31 #include "chrome/common/url_constants.h" | 31 #include "chrome/common/url_constants.h" |
32 #include "chrome/grit/generated_resources.h" | 32 #include "chrome/grit/generated_resources.h" |
33 #include "chrome/grit/locale_settings.h" | 33 #include "chrome/grit/locale_settings.h" |
34 #include "components/content_settings/core/browser/content_settings_details.h" | 34 #include "components/content_settings/core/browser/content_settings_details.h" |
35 #include "components/content_settings/core/browser/content_settings_utils.h" | 35 #include "components/content_settings/core/browser/content_settings_utils.h" |
36 #include "components/content_settings/core/browser/host_content_settings_map.h" | 36 #include "components/content_settings/core/browser/host_content_settings_map.h" |
37 #include "components/content_settings/core/browser/plugins_field_trial.h" | 37 #include "components/content_settings/core/browser/plugins_field_trial.h" |
| 38 #include "components/content_settings/core/browser/website_settings_info.h" |
| 39 #include "components/content_settings/core/browser/website_settings_registry.h" |
38 #include "components/content_settings/core/common/content_settings.h" | 40 #include "components/content_settings/core/common/content_settings.h" |
39 #include "components/content_settings/core/common/content_settings_pattern.h" | 41 #include "components/content_settings/core/common/content_settings_pattern.h" |
40 #include "components/google/core/browser/google_util.h" | 42 #include "components/google/core/browser/google_util.h" |
41 #include "components/signin/core/common/profile_management_switches.h" | 43 #include "components/signin/core/common/profile_management_switches.h" |
42 #include "components/user_prefs/user_prefs.h" | 44 #include "components/user_prefs/user_prefs.h" |
43 #include "content/public/browser/notification_service.h" | 45 #include "content/public/browser/notification_service.h" |
44 #include "content/public/browser/notification_source.h" | 46 #include "content/public/browser/notification_source.h" |
45 #include "content/public/browser/notification_types.h" | 47 #include "content/public/browser/notification_types.h" |
46 #include "content/public/browser/storage_partition.h" | 48 #include "content/public/browser/storage_partition.h" |
47 #include "content/public/browser/user_metrics.h" | 49 #include "content/public/browser/user_metrics.h" |
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 {"pushMessagingAllow", IDS_PUSH_MESSSAGING_ALLOW_RADIO}, | 427 {"pushMessagingAllow", IDS_PUSH_MESSSAGING_ALLOW_RADIO}, |
426 {"pushMessagingAsk", IDS_PUSH_MESSSAGING_ASK_RADIO}, | 428 {"pushMessagingAsk", IDS_PUSH_MESSSAGING_ASK_RADIO}, |
427 {"pushMessagingBlock", IDS_PUSH_MESSSAGING_BLOCK_RADIO}, | 429 {"pushMessagingBlock", IDS_PUSH_MESSSAGING_BLOCK_RADIO}, |
428 {"zoomlevelsHeader", IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL}, | 430 {"zoomlevelsHeader", IDS_ZOOMLEVELS_HEADER_AND_TAB_LABEL}, |
429 {"zoomLevelsManage", IDS_ZOOMLEVELS_MANAGE_BUTTON}, | 431 {"zoomLevelsManage", IDS_ZOOMLEVELS_MANAGE_BUTTON}, |
430 }; | 432 }; |
431 | 433 |
432 RegisterStrings(localized_strings, resources, arraysize(resources)); | 434 RegisterStrings(localized_strings, resources, arraysize(resources)); |
433 | 435 |
434 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); | 436 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); |
435 const base::Value* default_pref = | 437 const base::Value* default_pref = prefs->GetDefaultPrefValue( |
436 prefs->GetDefaultPrefValue(prefs::kDefaultPluginsSetting); | 438 content_settings::WebsiteSettingsRegistry::GetInstance() |
| 439 ->Get(CONTENT_SETTINGS_TYPE_PLUGINS) |
| 440 ->default_value_pref_name()); |
437 | 441 |
438 int default_value = CONTENT_SETTING_DEFAULT; | 442 int default_value = CONTENT_SETTING_DEFAULT; |
439 bool success = default_pref->GetAsInteger(&default_value); | 443 bool success = default_pref->GetAsInteger(&default_value); |
440 DCHECK(success); | 444 DCHECK(success); |
441 DCHECK_NE(default_value, CONTENT_SETTING_DEFAULT); | 445 DCHECK_NE(default_value, CONTENT_SETTING_DEFAULT); |
442 | 446 |
443 int plugin_ids = default_value == CONTENT_SETTING_DETECT_IMPORTANT_CONTENT ? | 447 int plugin_ids = default_value == CONTENT_SETTING_DETECT_IMPORTANT_CONTENT ? |
444 IDS_PLUGIN_DETECT_RECOMMENDED_RADIO : IDS_PLUGIN_DETECT_RADIO; | 448 IDS_PLUGIN_DETECT_RECOMMENDED_RADIO : IDS_PLUGIN_DETECT_RADIO; |
445 localized_strings->SetString("pluginsDetect", | 449 localized_strings->SetString("pluginsDetect", |
446 l10n_util::GetStringUTF16(plugin_ids)); | 450 l10n_util::GetStringUTF16(plugin_ids)); |
(...skipping 1173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1620 | 1624 |
1621 // Exceptions apply only when the feature is enabled. | 1625 // Exceptions apply only when the feature is enabled. |
1622 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); | 1626 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); |
1623 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); | 1627 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); |
1624 web_ui()->CallJavascriptFunction( | 1628 web_ui()->CallJavascriptFunction( |
1625 "ContentSettings.enableProtectedContentExceptions", | 1629 "ContentSettings.enableProtectedContentExceptions", |
1626 base::FundamentalValue(enable_exceptions)); | 1630 base::FundamentalValue(enable_exceptions)); |
1627 } | 1631 } |
1628 | 1632 |
1629 } // namespace options | 1633 } // namespace options |
OLD | NEW |