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

Unified Diff: components/doodle/doodle_types.cc

Issue 2710003006: [Doodle] Introduce a DoodleService (Closed)
Patch Set: equivalence 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
« components/doodle/doodle_types.h ('K') | « components/doodle/doodle_types.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.cc
diff --git a/components/doodle/doodle_types.cc b/components/doodle/doodle_types.cc
new file mode 100644
index 0000000000000000000000000000000000000000..249f9128d89e9dbfe4e8a6fa2f188e2818debdf2
--- /dev/null
+++ b/components/doodle/doodle_types.cc
@@ -0,0 +1,30 @@
+// 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.
+
+#include "components/doodle/doodle_types.h"
+
+namespace doodle {
+
+bool DoodleImage::operator==(const DoodleImage& other) const {
+ return url == other.url && height == other.height && width == other.width &&
+ is_animated_gif == other.is_animated_gif && is_cta == other.is_cta;
+}
+
+bool DoodleImage::operator!=(const DoodleImage& other) const {
+ return !(*this == other);
+}
+
+bool DoodleConfig::IsEquivalent(const DoodleConfig& other) const {
+ // Note: This compares all fields except for |expiry_date|, because that is
+ // computed as "now + time_to_live", so it'll never be exactly the same.
fhorschig 2017/02/27 17:44:07 s/so/because? (or 'otherwise'?)
Marc Treib 2017/02/28 10:25:49 "it" was supposed to refer to the expiry date. Ref
+ return doodle_type == other.doodle_type && alt_text == other.alt_text &&
+ interactive_html == other.interactive_html &&
+ search_url == other.search_url && target_url == other.target_url &&
+ fullpage_interactive_url == other.fullpage_interactive_url &&
+ large_image == other.large_image &&
+ large_cta_image == other.large_cta_image &&
+ transparent_large_image == other.transparent_large_image;
+}
+
+} // namespace doodle
« components/doodle/doodle_types.h ('K') | « components/doodle/doodle_types.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698