| 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 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 | 749 |
| 750 void ContentSettingsHandler::InitializePage() { | 750 void ContentSettingsHandler::InitializePage() { |
| 751 media_settings_.reset(new MediaSettingsInfo()); | 751 media_settings_.reset(new MediaSettingsInfo()); |
| 752 RefreshFlashMediaSettings(); | 752 RefreshFlashMediaSettings(); |
| 753 | 753 |
| 754 UpdateHandlersEnabledRadios(); | 754 UpdateHandlersEnabledRadios(); |
| 755 UpdateAllExceptionsViewsFromModel(); | 755 UpdateAllExceptionsViewsFromModel(); |
| 756 UpdateAllChooserExceptionsViewsFromModel(); | 756 UpdateAllChooserExceptionsViewsFromModel(); |
| 757 UpdateProtectedContentExceptionsButton(); | 757 UpdateProtectedContentExceptionsButton(); |
| 758 | 758 |
| 759 // In simplified fullscreen mode, fullscreen and mouselock settings are | 759 // Fullscreen and mouselock settings are ignored, but still stored. Always |
| 760 // ignored. Still, always show these settings (to give users the ability to | 760 // show the per-site settings (to give users the ability to view and delete |
| 761 // view and delete exceptions), but hide the global settings. | 761 // exceptions), but hide the global settings. |
| 762 bool hide_settings = | 762 // TODO(mgiuca): Remove this function and the global setting UI |
| 763 ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled(); | 763 // (https://crbug.com/610900). Then, delete all the per-site data and remove |
| 764 // this content setting entirely (https://crbug.com/591896). |
| 764 web_ui()->CallJavascriptFunction("ContentSettings.setExclusiveAccessVisible", | 765 web_ui()->CallJavascriptFunction("ContentSettings.setExclusiveAccessVisible", |
| 765 base::FundamentalValue(hide_settings), | 766 base::FundamentalValue(true), |
| 766 base::FundamentalValue(!hide_settings)); | 767 base::FundamentalValue(false)); |
| 767 } | 768 } |
| 768 | 769 |
| 769 void ContentSettingsHandler::OnContentSettingChanged( | 770 void ContentSettingsHandler::OnContentSettingChanged( |
| 770 const ContentSettingsPattern& primary_pattern, | 771 const ContentSettingsPattern& primary_pattern, |
| 771 const ContentSettingsPattern& secondary_pattern, | 772 const ContentSettingsPattern& secondary_pattern, |
| 772 ContentSettingsType content_type, | 773 ContentSettingsType content_type, |
| 773 std::string resource_identifier) { | 774 std::string resource_identifier) { |
| 774 const ContentSettingsDetails details( | 775 const ContentSettingsDetails details( |
| 775 primary_pattern, secondary_pattern, content_type, resource_identifier); | 776 primary_pattern, secondary_pattern, content_type, resource_identifier); |
| 776 // TODO(estade): we pretend update_all() is always true. | 777 // TODO(estade): we pretend update_all() is always true. |
| (...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1705 | 1706 |
| 1706 // Exceptions apply only when the feature is enabled. | 1707 // Exceptions apply only when the feature is enabled. |
| 1707 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); | 1708 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); |
| 1708 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); | 1709 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); |
| 1709 web_ui()->CallJavascriptFunction( | 1710 web_ui()->CallJavascriptFunction( |
| 1710 "ContentSettings.enableProtectedContentExceptions", | 1711 "ContentSettings.enableProtectedContentExceptions", |
| 1711 base::FundamentalValue(enable_exceptions)); | 1712 base::FundamentalValue(enable_exceptions)); |
| 1712 } | 1713 } |
| 1713 | 1714 |
| 1714 } // namespace options | 1715 } // namespace options |
| OLD | NEW |