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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 // } | 293 // } |
294 for (size_t j = 0; j < pattern_filter_str_list->GetSize(); ++j) { | 294 for (size_t j = 0; j < pattern_filter_str_list->GetSize(); ++j) { |
295 std::string pattern_filter_json; | 295 std::string pattern_filter_json; |
296 if (!pattern_filter_str_list->GetString(j, &pattern_filter_json)) { | 296 if (!pattern_filter_str_list->GetString(j, &pattern_filter_json)) { |
297 NOTREACHED(); | 297 NOTREACHED(); |
298 continue; | 298 continue; |
299 } | 299 } |
300 | 300 |
301 std::unique_ptr<base::Value> value = base::JSONReader::Read( | 301 std::unique_ptr<base::Value> value = base::JSONReader::Read( |
302 pattern_filter_json, base::JSON_ALLOW_TRAILING_COMMAS); | 302 pattern_filter_json, base::JSON_ALLOW_TRAILING_COMMAS); |
303 if (!value || !value->IsType(base::Value::TYPE_DICTIONARY)) { | 303 if (!value || !value->IsType(base::Value::Type::DICTIONARY)) { |
304 VLOG(1) << "Ignoring invalid certificate auto select setting. Reason:" | 304 VLOG(1) << "Ignoring invalid certificate auto select setting. Reason:" |
305 " Invalid JSON object: " << pattern_filter_json; | 305 " Invalid JSON object: " << pattern_filter_json; |
306 continue; | 306 continue; |
307 } | 307 } |
308 | 308 |
309 std::unique_ptr<base::DictionaryValue> pattern_filter_pair( | 309 std::unique_ptr<base::DictionaryValue> pattern_filter_pair( |
310 static_cast<base::DictionaryValue*>(value.release())); | 310 static_cast<base::DictionaryValue*>(value.release())); |
311 std::string pattern_str; | 311 std::string pattern_str; |
312 bool pattern_read = pattern_filter_pair->GetStringWithoutPathExpansion( | 312 bool pattern_read = pattern_filter_pair->GetStringWithoutPathExpansion( |
313 "pattern", &pattern_str); | 313 "pattern", &pattern_str); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 ReadManagedDefaultSettings(); | 435 ReadManagedDefaultSettings(); |
436 } | 436 } |
437 | 437 |
438 NotifyObservers(ContentSettingsPattern(), | 438 NotifyObservers(ContentSettingsPattern(), |
439 ContentSettingsPattern(), | 439 ContentSettingsPattern(), |
440 CONTENT_SETTINGS_TYPE_DEFAULT, | 440 CONTENT_SETTINGS_TYPE_DEFAULT, |
441 std::string()); | 441 std::string()); |
442 } | 442 } |
443 | 443 |
444 } // namespace content_settings | 444 } // namespace content_settings |
OLD | NEW |