Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Side by Side Diff: components/search_engines/template_url_data_util.h

Issue 2497853002: Create TemplateUrlData to base::Dictionary utility functions (Closed)
Patch Set: More fixes after review Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_DATA_UTIL_H_
6 #define COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_DATA_UTIL_H_
7
8 #include <memory>
9
10 namespace base {
11 class DictionaryValue;
12 }
13
14 namespace TemplateURLPrepopulateData {
15 struct PrepopulatedEngine;
16 }
17
18 struct TemplateURLData;
19
20 // Deserializes a TemplateURLData from |dict|.
21 std::unique_ptr<TemplateURLData> TemplateURLDataFromDictionary(
22 const base::DictionaryValue& dict);
23
24 // Serializes a TemplateURLData to |dict|
Peter Kasting 2016/11/21 02:17:07 Nit: Trailing period
25 std::unique_ptr<base::DictionaryValue> TemplateURLDataToDictionary(
26 const TemplateURLData& turl_data);
27
28 // Create TemplateURLData structure from PrepopulatedEngine structure.
29 std::unique_ptr<TemplateURLData> TemplateURLDataFromPrepopulatedEngine(
30 const TemplateURLPrepopulateData::PrepopulatedEngine& engine);
31
32 // Deserializes a TemplateURLData from |dict| as stored in
33 // 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
34 // serialization functions above for historical reasons.
35 // TODO(a-v-y) Migrate to single TemplateURLData serialization format.
36 std::unique_ptr<TemplateURLData> TemplateURLDataFromOverrideDictionary(
37 const base::DictionaryValue& engine);
38
39 #endif // COMPONENTS_SEARCH_ENGINES_TEMPLATE_URL_DATA_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698