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 "components/content_settings/core/browser/content_settings_policy_provi
der.h" | 5 #include "components/content_settings/core/browser/content_settings_policy_provi
der.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 // } | 264 // } |
265 // } | 265 // } |
266 // } | 266 // } |
267 for (size_t j = 0; j < pattern_filter_str_list->GetSize(); ++j) { | 267 for (size_t j = 0; j < pattern_filter_str_list->GetSize(); ++j) { |
268 std::string pattern_filter_json; | 268 std::string pattern_filter_json; |
269 if (!pattern_filter_str_list->GetString(j, &pattern_filter_json)) { | 269 if (!pattern_filter_str_list->GetString(j, &pattern_filter_json)) { |
270 NOTREACHED(); | 270 NOTREACHED(); |
271 continue; | 271 continue; |
272 } | 272 } |
273 | 273 |
274 scoped_ptr<base::Value> value(base::JSONReader::DeprecatedRead( | 274 scoped_ptr<base::Value> value = base::JSONReader::Read( |
275 pattern_filter_json, base::JSON_ALLOW_TRAILING_COMMAS)); | 275 pattern_filter_json, base::JSON_ALLOW_TRAILING_COMMAS); |
276 if (!value || !value->IsType(base::Value::TYPE_DICTIONARY)) { | 276 if (!value || !value->IsType(base::Value::TYPE_DICTIONARY)) { |
277 VLOG(1) << "Ignoring invalid certificate auto select setting. Reason:" | 277 VLOG(1) << "Ignoring invalid certificate auto select setting. Reason:" |
278 " Invalid JSON object: " << pattern_filter_json; | 278 " Invalid JSON object: " << pattern_filter_json; |
279 continue; | 279 continue; |
280 } | 280 } |
281 | 281 |
282 scoped_ptr<base::DictionaryValue> pattern_filter_pair( | 282 scoped_ptr<base::DictionaryValue> pattern_filter_pair( |
283 static_cast<base::DictionaryValue*>(value.release())); | 283 static_cast<base::DictionaryValue*>(value.release())); |
284 std::string pattern_str; | 284 std::string pattern_str; |
285 bool pattern_read = pattern_filter_pair->GetStringWithoutPathExpansion( | 285 bool pattern_read = pattern_filter_pair->GetStringWithoutPathExpansion( |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 ReadManagedDefaultSettings(); | 400 ReadManagedDefaultSettings(); |
401 } | 401 } |
402 | 402 |
403 NotifyObservers(ContentSettingsPattern(), | 403 NotifyObservers(ContentSettingsPattern(), |
404 ContentSettingsPattern(), | 404 ContentSettingsPattern(), |
405 CONTENT_SETTINGS_TYPE_DEFAULT, | 405 CONTENT_SETTINGS_TYPE_DEFAULT, |
406 std::string()); | 406 std::string()); |
407 } | 407 } |
408 | 408 |
409 } // namespace content_settings | 409 } // namespace content_settings |
OLD | NEW |