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 "components/search_provider_logos/logo_cache.h" | 5 #include "components/search_provider_logos/logo_cache.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 | 12 |
13 namespace { | 13 namespace { |
14 | 14 |
15 // The cached logo metadata is persisted as JSON using these keys. | 15 // The cached logo metadata is persisted as JSON using these keys. |
16 const char kSourceUrlKey[] = "url"; | 16 const char kSourceUrlKey[] = "url"; |
17 const char kExpirationTimeKey[] = "expiration_time"; | 17 const char kExpirationTimeKey[] = "expiration_time"; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 base::DeleteFile(GetMetadataPath(), false); | 226 base::DeleteFile(GetMetadataPath(), false); |
227 } | 227 } |
228 | 228 |
229 bool LogoCache::EnsureCacheDirectoryExists() { | 229 bool LogoCache::EnsureCacheDirectoryExists() { |
230 if (base::DirectoryExists(cache_directory_)) | 230 if (base::DirectoryExists(cache_directory_)) |
231 return true; | 231 return true; |
232 return base::CreateDirectory(cache_directory_); | 232 return base::CreateDirectory(cache_directory_); |
233 } | 233 } |
234 | 234 |
235 } // namespace search_provider_logos | 235 } // namespace search_provider_logos |
OLD | NEW |