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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 1228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1239 ExContentSettingsType type = ExContentSettingsTypeFromGroupName(type_string); | 1239 ExContentSettingsType type = ExContentSettingsTypeFromGroupName(type_string); |
1240 bool is_valid = false; | 1240 bool is_valid = false; |
1241 if (type == EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC) { | 1241 if (type == EX_CONTENT_SETTINGS_TYPE_PEPPER_FLASH_CAMERAMIC) { |
1242 is_valid = IsValidHost(pattern_string); | 1242 is_valid = IsValidHost(pattern_string); |
1243 } else { | 1243 } else { |
1244 ContentSettingsPattern pattern = | 1244 ContentSettingsPattern pattern = |
1245 ContentSettingsPattern::FromString(pattern_string); | 1245 ContentSettingsPattern::FromString(pattern_string); |
1246 is_valid = pattern.IsValid(); | 1246 is_valid = pattern.IsValid(); |
1247 } | 1247 } |
1248 | 1248 |
1249 scoped_ptr<Value> type_value(Value::CreateStringValue(type_string)); | 1249 scoped_ptr<Value> type_value(new base::StringValue(type_string)); |
Evan Stade
2012/11/30 22:47:00
why do these still exist
tfarina
2012/11/30 23:07:31
Done.
| |
1250 scoped_ptr<Value> mode_value(Value::CreateStringValue(mode_string)); | 1250 scoped_ptr<Value> mode_value(new base::StringValue(mode_string)); |
1251 scoped_ptr<Value> pattern_value(Value::CreateStringValue(pattern_string)); | 1251 scoped_ptr<Value> pattern_value(new base::StringValue(pattern_string)); |
1252 scoped_ptr<Value> valid_value(Value::CreateBooleanValue(is_valid)); | 1252 scoped_ptr<Value> valid_value(Value::CreateBooleanValue(is_valid)); |
1253 | 1253 |
1254 web_ui()->CallJavascriptFunction( | 1254 web_ui()->CallJavascriptFunction( |
1255 "ContentSettings.patternValidityCheckComplete", | 1255 "ContentSettings.patternValidityCheckComplete", |
1256 *type_value.get(), | 1256 base::StringValue(type_string), |
1257 *mode_value.get(), | 1257 base::StringValue(mode_string), |
1258 *pattern_value.get(), | 1258 base::StringValue(pattern_string), |
1259 *valid_value.get()); | 1259 base::FundamentalValue(is_valid)); |
1260 } | 1260 } |
1261 | 1261 |
1262 // static | 1262 // static |
1263 std::string ContentSettingsHandler::ContentSettingsTypeToGroupName( | 1263 std::string ContentSettingsHandler::ContentSettingsTypeToGroupName( |
1264 ContentSettingsType type) { | 1264 ContentSettingsType type) { |
1265 return ExContentSettingsTypeToGroupName(ExContentSettingsType(type)); | 1265 return ExContentSettingsTypeToGroupName(ExContentSettingsType(type)); |
1266 } | 1266 } |
1267 | 1267 |
1268 HostContentSettingsMap* ContentSettingsHandler::GetContentSettingsMap() { | 1268 HostContentSettingsMap* ContentSettingsHandler::GetContentSettingsMap() { |
1269 return Profile::FromWebUI(web_ui())->GetHostContentSettingsMap(); | 1269 return Profile::FromWebUI(web_ui())->GetHostContentSettingsMap(); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1312 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { | 1312 for (size_t i = 0; i < arraysize(kExContentSettingsTypeGroupNames); ++i) { |
1313 if (type == kExContentSettingsTypeGroupNames[i].type) | 1313 if (type == kExContentSettingsTypeGroupNames[i].type) |
1314 return kExContentSettingsTypeGroupNames[i].name; | 1314 return kExContentSettingsTypeGroupNames[i].name; |
1315 } | 1315 } |
1316 | 1316 |
1317 NOTREACHED(); | 1317 NOTREACHED(); |
1318 return std::string(); | 1318 return std::string(); |
1319 } | 1319 } |
1320 | 1320 |
1321 } // namespace options | 1321 } // namespace options |
OLD | NEW |