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

Unified Diff: components/doodle/doodle_types.h

Issue 2710673006: [Doodle] Pull a doodle_types.h out of doodle_fetcher.h (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « components/doodle/doodle_fetcher.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/doodle/doodle_types.h
diff --git a/components/doodle/doodle_types.h b/components/doodle/doodle_types.h
new file mode 100644
index 0000000000000000000000000000000000000000..a4d92ff6c4d070f02a97ee9b03c1685d17f2ecca
--- /dev/null
+++ b/components/doodle/doodle_types.h
@@ -0,0 +1,67 @@
+// Copyright 2017 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_DOODLE_DOODLE_TYPES_H_
+#define COMPONENTS_DOODLE_DOODLE_TYPES_H_
+
+#include "url/gurl.h"
+
+namespace doodle {
+
+enum class DoodleState {
+ AVAILABLE,
+ NO_DOODLE,
+ DOWNLOAD_ERROR,
+ PARSING_ERROR,
+};
+
+enum class DoodleType {
+ UNKNOWN,
+ SIMPLE,
+ RANDOM,
+ VIDEO,
+ INTERACTIVE,
+ INLINE_INTERACTIVE,
+ SLIDESHOW,
+};
+
+// Information about a Doodle image. If the image is invalid, the |url| will be
+// empty and invalid. By default the dimensions are 0.
+struct DoodleImage {
+ DoodleImage();
+ ~DoodleImage();
+
+ GURL url;
+ int height;
+ int width;
+ bool is_animated_gif;
+ bool is_cta;
+
+ // Copying and assignment allowed.
+};
+
+// All information about a current doodle that can be fetched from the remote
+// end. By default, all URLs are empty and therefore invalid.
+struct DoodleConfig {
+ DoodleConfig();
+ DoodleConfig(const DoodleConfig& config); // = default;
+ ~DoodleConfig();
+
+ DoodleType doodle_type;
+ std::string alt_text;
+ std::string interactive_html;
+
+ base::Time expiry_date;
+ GURL search_url;
+ GURL target_url;
+ GURL fullpage_interactive_url;
+
+ DoodleImage large_image;
+ DoodleImage large_cta_image;
+ DoodleImage transparent_large_image;
+};
+
+} // namespace doodle
+
+#endif // COMPONENTS_DOODLE_DOODLE_TYPES_H_
« no previous file with comments | « components/doodle/doodle_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698