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 <stddef.h> | 7 #include <stddef.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <map> | 9 #include <map> |
10 #include <utility> | 10 #include <utility> |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
783 ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled(); | 783 ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled(); |
784 web_ui()->CallJavascriptFunction("ContentSettings.setExclusiveAccessVisible", | 784 web_ui()->CallJavascriptFunction("ContentSettings.setExclusiveAccessVisible", |
785 base::FundamentalValue(hide_settings), | 785 base::FundamentalValue(hide_settings), |
786 base::FundamentalValue(!hide_settings)); | 786 base::FundamentalValue(!hide_settings)); |
787 } | 787 } |
788 | 788 |
789 void ContentSettingsHandler::OnContentSettingChanged( | 789 void ContentSettingsHandler::OnContentSettingChanged( |
790 const ContentSettingsPattern& primary_pattern, | 790 const ContentSettingsPattern& primary_pattern, |
791 const ContentSettingsPattern& secondary_pattern, | 791 const ContentSettingsPattern& secondary_pattern, |
792 ContentSettingsType content_type, | 792 ContentSettingsType content_type, |
| 793 ContentSetting previous_value, |
793 std::string resource_identifier) { | 794 std::string resource_identifier) { |
794 const ContentSettingsDetails details( | 795 const ContentSettingsDetails details( |
795 primary_pattern, secondary_pattern, content_type, resource_identifier); | 796 primary_pattern, secondary_pattern, content_type, resource_identifier); |
796 // TODO(estade): we pretend update_all() is always true. | 797 // TODO(estade): we pretend update_all() is always true. |
797 if (details.update_all_types()) { | 798 if (details.update_all_types()) { |
798 UpdateAllExceptionsViewsFromModel(); | 799 UpdateAllExceptionsViewsFromModel(); |
799 UpdateAllChooserExceptionsViewsFromModel(); | 800 UpdateAllChooserExceptionsViewsFromModel(); |
800 } else { | 801 } else { |
801 if (ContainsKey(GetExceptionsInfoMap(), details.type())) | 802 if (ContainsKey(GetExceptionsInfoMap(), details.type())) |
802 UpdateExceptionsViewFromModel(details.type()); | 803 UpdateExceptionsViewFromModel(details.type()); |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1851 | 1852 |
1852 // Exceptions apply only when the feature is enabled. | 1853 // Exceptions apply only when the feature is enabled. |
1853 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); | 1854 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); |
1854 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); | 1855 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); |
1855 web_ui()->CallJavascriptFunction( | 1856 web_ui()->CallJavascriptFunction( |
1856 "ContentSettings.enableProtectedContentExceptions", | 1857 "ContentSettings.enableProtectedContentExceptions", |
1857 base::FundamentalValue(enable_exceptions)); | 1858 base::FundamentalValue(enable_exceptions)); |
1858 } | 1859 } |
1859 | 1860 |
1860 } // namespace options | 1861 } // namespace options |
OLD | NEW |