OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/supervised_user/supervised_user_site_list.h" | 5 #include "chrome/browser/supervised_user/supervised_user_site_list.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/json/json_file_value_serializer.h" | 10 #include "base/json/json_file_value_serializer.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 << error_msg; | 41 << error_msg; |
42 } | 42 } |
43 return value; | 43 return value; |
44 } | 44 } |
45 | 45 |
46 std::vector<std::string> ConvertListValues(const base::ListValue* list_values) { | 46 std::vector<std::string> ConvertListValues(const base::ListValue* list_values) { |
47 std::vector<std::string> converted; | 47 std::vector<std::string> converted; |
48 if (list_values) { | 48 if (list_values) { |
49 for (const auto& entry : *list_values) { | 49 for (const auto& entry : *list_values) { |
50 std::string entry_string; | 50 std::string entry_string; |
51 if (!entry.GetAsString(&entry_string)) { | 51 if (!entry->GetAsString(&entry_string)) { |
52 LOG(ERROR) << "Invalid whitelist entry"; | 52 LOG(ERROR) << "Invalid whitelist entry"; |
53 continue; | 53 continue; |
54 } | 54 } |
55 | 55 |
56 converted.push_back(entry_string); | 56 converted.push_back(entry_string); |
57 } | 57 } |
58 } | 58 } |
59 return converted; | 59 return converted; |
60 } | 60 } |
61 | 61 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 base::ListValue* patterns = nullptr; | 191 base::ListValue* patterns = nullptr; |
192 dict->GetList(kWhitelistKey, &patterns); | 192 dict->GetList(kWhitelistKey, &patterns); |
193 | 193 |
194 base::ListValue* hostname_hashes = nullptr; | 194 base::ListValue* hostname_hashes = nullptr; |
195 dict->GetList(kHostnameHashesKey, &hostname_hashes); | 195 dict->GetList(kHostnameHashesKey, &hostname_hashes); |
196 | 196 |
197 callback.Run(make_scoped_refptr( | 197 callback.Run(make_scoped_refptr( |
198 new SupervisedUserSiteList(id, title, GURL(entry_point_url), | 198 new SupervisedUserSiteList(id, title, GURL(entry_point_url), |
199 large_icon_path, patterns, hostname_hashes))); | 199 large_icon_path, patterns, hostname_hashes))); |
200 } | 200 } |
OLD | NEW |