| 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" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/metrics/histogram_macros.h" | 12 #include "base/metrics/histogram_macros.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/task_runner_util.h" | 14 #include "base/task_runner_util.h" |
| 15 #include "base/threading/sequenced_worker_pool.h" | |
| 16 #include "base/values.h" | 15 #include "base/values.h" |
| 17 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
| 18 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 19 | 18 |
| 20 const int kLegacyWhitelistFormatVersion = 2; | 19 const int kLegacyWhitelistFormatVersion = 2; |
| 21 const int kWhitelistFormatVersion = 1; | 20 const int kWhitelistFormatVersion = 1; |
| 22 | 21 |
| 23 const char kEntryPointUrlKey[] = "entry_point_url"; | 22 const char kEntryPointUrlKey[] = "entry_point_url"; |
| 24 const char kHostnameHashesKey[] = "hostname_hashes"; | 23 const char kHostnameHashesKey[] = "hostname_hashes"; |
| 25 const char kLegacyWhitelistFormatVersionKey[] = "version"; | 24 const char kLegacyWhitelistFormatVersionKey[] = "version"; |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 base::ListValue* patterns = nullptr; | 190 base::ListValue* patterns = nullptr; |
| 192 dict->GetList(kWhitelistKey, &patterns); | 191 dict->GetList(kWhitelistKey, &patterns); |
| 193 | 192 |
| 194 base::ListValue* hostname_hashes = nullptr; | 193 base::ListValue* hostname_hashes = nullptr; |
| 195 dict->GetList(kHostnameHashesKey, &hostname_hashes); | 194 dict->GetList(kHostnameHashesKey, &hostname_hashes); |
| 196 | 195 |
| 197 callback.Run(make_scoped_refptr( | 196 callback.Run(make_scoped_refptr( |
| 198 new SupervisedUserSiteList(id, title, GURL(entry_point_url), | 197 new SupervisedUserSiteList(id, title, GURL(entry_point_url), |
| 199 large_icon_path, patterns, hostname_hashes))); | 198 large_icon_path, patterns, hostname_hashes))); |
| 200 } | 199 } |
| OLD | NEW |