| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/doodle/doodle_types.h" | 5 #include "components/doodle/doodle_types.h" |
| 6 | 6 |
| 7 namespace doodle { | 7 namespace doodle { |
| 8 | 8 |
| 9 bool DoodleImage::operator==(const DoodleImage& other) const { | 9 bool DoodleImage::operator==(const DoodleImage& other) const { |
| 10 return url == other.url && height == other.height && width == other.width && | 10 return url == other.url && height == other.height && width == other.width && |
| 11 is_animated_gif == other.is_animated_gif && is_cta == other.is_cta; | 11 is_animated_gif == other.is_animated_gif && is_cta == other.is_cta; |
| 12 } | 12 } |
| 13 | 13 |
| 14 bool DoodleImage::operator!=(const DoodleImage& other) const { | 14 bool DoodleImage::operator!=(const DoodleImage& other) const { |
| 15 return !(*this == other); | 15 return !(*this == other); |
| 16 } | 16 } |
| 17 | 17 |
| 18 bool DoodleConfig::IsEquivalent(const DoodleConfig& other) const { | 18 bool DoodleConfig::operator==(const DoodleConfig& other) const { |
| 19 // Note: This compares all fields except for |time_to_live|, which by | |
| 20 // definition isn't constant over time, and shouldn't be in DoodleConfig in | |
| 21 // the first place. | |
| 22 return doodle_type == other.doodle_type && alt_text == other.alt_text && | 19 return doodle_type == other.doodle_type && alt_text == other.alt_text && |
| 23 interactive_html == other.interactive_html && | 20 interactive_html == other.interactive_html && |
| 24 search_url == other.search_url && target_url == other.target_url && | 21 search_url == other.search_url && target_url == other.target_url && |
| 25 fullpage_interactive_url == other.fullpage_interactive_url && | 22 fullpage_interactive_url == other.fullpage_interactive_url && |
| 26 large_image == other.large_image && | 23 large_image == other.large_image && |
| 27 large_cta_image == other.large_cta_image && | 24 large_cta_image == other.large_cta_image && |
| 28 transparent_large_image == other.transparent_large_image; | 25 transparent_large_image == other.transparent_large_image; |
| 29 } | 26 } |
| 30 | 27 |
| 28 bool DoodleConfig::operator!=(const DoodleConfig& other) const { |
| 29 return !(*this == other); |
| 30 } |
| 31 |
| 31 } // namespace doodle | 32 } // namespace doodle |
| OLD | NEW |