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 704 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 const ContentSettingsPattern& secondary_pattern, | 715 const ContentSettingsPattern& secondary_pattern, |
716 ContentSettingsType content_type, | 716 ContentSettingsType content_type, |
717 std::string resource_identifier) { | 717 std::string resource_identifier) { |
718 const ContentSettingsDetails details( | 718 const ContentSettingsDetails details( |
719 primary_pattern, secondary_pattern, content_type, resource_identifier); | 719 primary_pattern, secondary_pattern, content_type, resource_identifier); |
720 // TODO(estade): we pretend update_all() is always true. | 720 // TODO(estade): we pretend update_all() is always true. |
721 if (details.update_all_types()) { | 721 if (details.update_all_types()) { |
722 UpdateAllExceptionsViewsFromModel(); | 722 UpdateAllExceptionsViewsFromModel(); |
723 UpdateAllChooserExceptionsViewsFromModel(); | 723 UpdateAllChooserExceptionsViewsFromModel(); |
724 } else { | 724 } else { |
725 if (ContainsKey(GetExceptionsInfoMap(), details.type())) | 725 if (base::ContainsKey(GetExceptionsInfoMap(), details.type())) |
726 UpdateExceptionsViewFromModel(details.type()); | 726 UpdateExceptionsViewFromModel(details.type()); |
727 } | 727 } |
728 } | 728 } |
729 | 729 |
730 void ContentSettingsHandler::Observe( | 730 void ContentSettingsHandler::Observe( |
731 int type, | 731 int type, |
732 const content::NotificationSource& source, | 732 const content::NotificationSource& source, |
733 const content::NotificationDetails& details) { | 733 const content::NotificationDetails& details) { |
734 switch (type) { | 734 switch (type) { |
735 case chrome::NOTIFICATION_PROFILE_DESTROYED: { | 735 case chrome::NOTIFICATION_PROFILE_DESTROYED: { |
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1655 | 1655 |
1656 // Exceptions apply only when the feature is enabled. | 1656 // Exceptions apply only when the feature is enabled. |
1657 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); | 1657 PrefService* prefs = user_prefs::UserPrefs::Get(GetBrowserContext(web_ui())); |
1658 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); | 1658 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); |
1659 web_ui()->CallJavascriptFunctionUnsafe( | 1659 web_ui()->CallJavascriptFunctionUnsafe( |
1660 "ContentSettings.enableProtectedContentExceptions", | 1660 "ContentSettings.enableProtectedContentExceptions", |
1661 base::FundamentalValue(enable_exceptions)); | 1661 base::FundamentalValue(enable_exceptions)); |
1662 } | 1662 } |
1663 | 1663 |
1664 } // namespace options | 1664 } // namespace options |
OLD | NEW |