| 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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 } | 597 } |
| 598 | 598 |
| 599 void ContentSettingsHandler::UpdateSettingDefaultFromModel( | 599 void ContentSettingsHandler::UpdateSettingDefaultFromModel( |
| 600 ContentSettingsType type) { | 600 ContentSettingsType type) { |
| 601 Profile* profile = Profile::FromWebUI(web_ui()); | 601 Profile* profile = Profile::FromWebUI(web_ui()); |
| 602 std::string provider_id; | 602 std::string provider_id; |
| 603 ContentSetting default_setting = | 603 ContentSetting default_setting = |
| 604 profile->GetHostContentSettingsMap()->GetDefaultContentSetting( | 604 profile->GetHostContentSettingsMap()->GetDefaultContentSetting( |
| 605 type, &provider_id); | 605 type, &provider_id); |
| 606 | 606 |
| 607 // For Plugins, display the obsolete ASK setting as DETECT. | 607 // For Plugins, display the obsolete ASK setting as BLOCK. |
| 608 if (type == ContentSettingsType::CONTENT_SETTINGS_TYPE_PLUGINS && | 608 if (type == ContentSettingsType::CONTENT_SETTINGS_TYPE_PLUGINS && |
| 609 default_setting == ContentSetting::CONTENT_SETTING_ASK) { | 609 default_setting == ContentSetting::CONTENT_SETTING_ASK) { |
| 610 default_setting = ContentSetting::CONTENT_SETTING_DETECT_IMPORTANT_CONTENT; | 610 default_setting = ContentSetting::CONTENT_SETTING_BLOCK; |
| 611 } | 611 } |
| 612 | 612 |
| 613 base::DictionaryValue filter_settings; | 613 base::DictionaryValue filter_settings; |
| 614 filter_settings.SetString(ContentSettingsTypeToGroupName(type) + ".value", | 614 filter_settings.SetString(ContentSettingsTypeToGroupName(type) + ".value", |
| 615 ContentSettingToString(default_setting)); | 615 ContentSettingToString(default_setting)); |
| 616 filter_settings.SetString( | 616 filter_settings.SetString( |
| 617 ContentSettingsTypeToGroupName(type) + ".managedBy", provider_id); | 617 ContentSettingsTypeToGroupName(type) + ".managedBy", provider_id); |
| 618 | 618 |
| 619 web_ui()->CallJavascriptFunction( | 619 web_ui()->CallJavascriptFunction( |
| 620 "ContentSettings.setContentFilterSettingsValue", filter_settings); | 620 "ContentSettings.setContentFilterSettingsValue", filter_settings); |
| (...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1595 | 1595 |
| 1596 // Exceptions apply only when the feature is enabled. | 1596 // Exceptions apply only when the feature is enabled. |
| 1597 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); | 1597 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); |
| 1598 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); | 1598 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); |
| 1599 web_ui()->CallJavascriptFunction( | 1599 web_ui()->CallJavascriptFunction( |
| 1600 "ContentSettings.enableProtectedContentExceptions", | 1600 "ContentSettings.enableProtectedContentExceptions", |
| 1601 base::FundamentalValue(enable_exceptions)); | 1601 base::FundamentalValue(enable_exceptions)); |
| 1602 } | 1602 } |
| 1603 | 1603 |
| 1604 } // namespace options | 1604 } // namespace options |
| OLD | NEW |