Chromium Code Reviews| Index: components/search_engines/template_url_data_util.h |
| diff --git a/components/search_engines/template_url_data_util.h b/components/search_engines/template_url_data_util.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1ca7d5246faab6ce750b3a08fd64d76049a18c68 |
| --- /dev/null |
| +++ b/components/search_engines/template_url_data_util.h |
| @@ -0,0 +1,39 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_DATA_UTIL_H_ |
| +#define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_DATA_UTIL_H_ |
| + |
| +#include <memory> |
| + |
| +namespace base { |
| +class DictionaryValue; |
| +} |
| + |
| +namespace TemplateURLPrepopulateData { |
| +struct PrepopulatedEngine; |
| +} |
| + |
| +struct TemplateURLData; |
| + |
| +// Deserializes a TemplateURLData from |dict|. |
| +std::unique_ptr<TemplateURLData> TemplateURLDataFromDictionary( |
| + const base::DictionaryValue& dict); |
| + |
| +// Serializes a TemplateURLData to |dict| |
|
Peter Kasting
2016/11/21 02:17:07
Nit: Trailing period
|
| +std::unique_ptr<base::DictionaryValue> TemplateURLDataToDictionary( |
| + const TemplateURLData& turl_data); |
| + |
| +// Create TemplateURLData structure from PrepopulatedEngine structure. |
| +std::unique_ptr<TemplateURLData> TemplateURLDataFromPrepopulatedEngine( |
| + const TemplateURLPrepopulateData::PrepopulatedEngine& engine); |
| + |
| +// Deserializes a TemplateURLData from |dict| as stored in |
| +// kSearchProviderOverrides pref. Name of values in |dict| are different from |
|
Peter Kasting
2016/11/21 02:17:07
Nit: Maybe this second sentence would be slightly
|
| +// serialization functions above for historical reasons. |
| +// TODO(a-v-y) Migrate to single TemplateURLData serialization format. |
| +std::unique_ptr<TemplateURLData> TemplateURLDataFromOverrideDictionary( |
| + const base::DictionaryValue& engine); |
| + |
| +#endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_DATA_UTIL_H_ |