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

Unified Diff: components/doodle/doodle_types.h

Issue 2740013005: [Doodle] Move parsing from fetcher into the types themselves (Closed)
Patch Set: -auto Created 3 years, 9 months 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
Index: components/doodle/doodle_types.h
diff --git a/components/doodle/doodle_types.h b/components/doodle/doodle_types.h
index d97b50bd0fb0b05e90ad8e16fbbdaae4fc746b9c..058aa10d9a3c13fdb9e05b784af9ffbdb04b27a0 100644
--- a/components/doodle/doodle_types.h
+++ b/components/doodle/doodle_types.h
@@ -5,8 +5,13 @@
#ifndef COMPONENTS_DOODLE_DOODLE_TYPES_H_
#define COMPONENTS_DOODLE_DOODLE_TYPES_H_
+#include "base/optional.h"
#include "url/gurl.h"
+namespace base {
+class DictionaryValue;
+}
+
namespace doodle {
enum class DoodleState {
@@ -32,6 +37,10 @@ struct DoodleImage {
DoodleImage();
~DoodleImage();
+ static base::Optional<DoodleImage> FromDictionary(
+ const base::DictionaryValue& dict,
+ const base::Optional<GURL>& base_url);
+
bool operator==(const DoodleImage& other) const;
bool operator!=(const DoodleImage& other) const;
@@ -51,6 +60,10 @@ struct DoodleConfig {
DoodleConfig(const DoodleConfig& config); // = default;
~DoodleConfig();
+ static base::Optional<DoodleConfig> FromDictionary(
+ const base::DictionaryValue& dict,
+ const base::Optional<GURL>& base_url);
+
bool operator==(const DoodleConfig& other) const;
bool operator!=(const DoodleConfig& other) const;

Powered by Google App Engine
This is Rietveld 408576698