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

Unified Diff: components/search_engines/template_url_data_util.h

Issue 2497853002: Create TemplateUrlData to base::Dictionary utility functions (Closed)
Patch Set: Fixed android compilation 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/search_engines/template_url_data.cc ('k') | components/search_engines/template_url_data_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..f99ae052cd95b3cc048885b07b1bbf34151a7fc4
--- /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|.
+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. The field names in |dict| differ from those
+// used in the To/FromDictionary 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_
« no previous file with comments | « components/search_engines/template_url_data.cc ('k') | components/search_engines/template_url_data_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698