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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1202 const base::ListValue* args, | 1202 const base::ListValue* args, |
1203 ContentSettingsType type) { | 1203 ContentSettingsType type) { |
1204 std::string mode; | 1204 std::string mode; |
1205 bool rv = args->GetString(1, &mode); | 1205 bool rv = args->GetString(1, &mode); |
1206 DCHECK(rv); | 1206 DCHECK(rv); |
1207 | 1207 |
1208 std::string pattern; | 1208 std::string pattern; |
1209 rv = args->GetString(2, &pattern); | 1209 rv = args->GetString(2, &pattern); |
1210 DCHECK(rv); | 1210 DCHECK(rv); |
1211 | 1211 |
1212 // The third argument to this handler is optional. | 1212 // The fourth argument to this handler is optional. |
1213 std::string secondary_pattern; | 1213 std::string secondary_pattern; |
1214 if (args->GetSize() == 3U) { | 1214 if (args->GetSize() >= 4U) { |
1215 rv = args->GetString(3, &secondary_pattern); | 1215 rv = args->GetString(3, &secondary_pattern); |
1216 DCHECK(rv); | 1216 DCHECK(rv); |
1217 } | 1217 } |
1218 | 1218 |
1219 HostContentSettingsMap* settings_map = | 1219 HostContentSettingsMap* settings_map = |
1220 mode == "normal" ? GetContentSettingsMap() : | 1220 mode == "normal" ? GetContentSettingsMap() : |
1221 GetOTRContentSettingsMap(); | 1221 GetOTRContentSettingsMap(); |
1222 if (settings_map) { | 1222 if (settings_map) { |
1223 settings_map->SetWebsiteSetting( | 1223 settings_map->SetWebsiteSetting( |
1224 ContentSettingsPattern::FromString(pattern), | 1224 ContentSettingsPattern::FromString(pattern), |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1564 void ContentSettingsHandler::UpdateProtectedContentExceptionsButton() { | 1564 void ContentSettingsHandler::UpdateProtectedContentExceptionsButton() { |
1565 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); | 1565 PrefService* prefs = Profile::FromWebUI(web_ui())->GetPrefs(); |
1566 // Exceptions apply only when the feature is enabled. | 1566 // Exceptions apply only when the feature is enabled. |
1567 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); | 1567 bool enable_exceptions = prefs->GetBoolean(prefs::kEnableDRM); |
1568 web_ui()->CallJavascriptFunction( | 1568 web_ui()->CallJavascriptFunction( |
1569 "ContentSettings.enableProtectedContentExceptions", | 1569 "ContentSettings.enableProtectedContentExceptions", |
1570 base::FundamentalValue(enable_exceptions)); | 1570 base::FundamentalValue(enable_exceptions)); |
1571 } | 1571 } |
1572 | 1572 |
1573 } // namespace options | 1573 } // namespace options |
OLD | NEW |