| 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 #ifndef COMPONENTS_DOODLE_DOODLE_TYPES_H_ | 5 #ifndef COMPONENTS_DOODLE_DOODLE_TYPES_H_ |
| 6 #define COMPONENTS_DOODLE_DOODLE_TYPES_H_ | 6 #define COMPONENTS_DOODLE_DOODLE_TYPES_H_ |
| 7 | 7 |
| 8 #include "base/time/time.h" | |
| 9 #include "url/gurl.h" | 8 #include "url/gurl.h" |
| 10 | 9 |
| 11 namespace doodle { | 10 namespace doodle { |
| 12 | 11 |
| 13 enum class DoodleState { | 12 enum class DoodleState { |
| 14 AVAILABLE, | 13 AVAILABLE, |
| 15 NO_DOODLE, | 14 NO_DOODLE, |
| 16 DOWNLOAD_ERROR, | 15 DOWNLOAD_ERROR, |
| 17 PARSING_ERROR, | 16 PARSING_ERROR, |
| 18 }; | 17 }; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 45 // Copying and assignment allowed. | 44 // Copying and assignment allowed. |
| 46 }; | 45 }; |
| 47 | 46 |
| 48 // All information about a current doodle that can be fetched from the remote | 47 // All information about a current doodle that can be fetched from the remote |
| 49 // end. By default, all URLs are empty and therefore invalid. | 48 // end. By default, all URLs are empty and therefore invalid. |
| 50 struct DoodleConfig { | 49 struct DoodleConfig { |
| 51 DoodleConfig(); | 50 DoodleConfig(); |
| 52 DoodleConfig(const DoodleConfig& config); // = default; | 51 DoodleConfig(const DoodleConfig& config); // = default; |
| 53 ~DoodleConfig(); | 52 ~DoodleConfig(); |
| 54 | 53 |
| 55 // Checks whether this config is "equivalent" to the other. This compares all | 54 bool operator==(const DoodleConfig& other) const; |
| 56 // fields for equality, except for |expiry_date|. | 55 bool operator!=(const DoodleConfig& other) const; |
| 57 bool IsEquivalent(const DoodleConfig& other) const; | |
| 58 | 56 |
| 59 DoodleType doodle_type; | 57 DoodleType doodle_type; |
| 60 std::string alt_text; | 58 std::string alt_text; |
| 61 std::string interactive_html; | 59 std::string interactive_html; |
| 62 | 60 |
| 63 GURL search_url; | 61 GURL search_url; |
| 64 GURL target_url; | 62 GURL target_url; |
| 65 GURL fullpage_interactive_url; | 63 GURL fullpage_interactive_url; |
| 66 | 64 |
| 67 DoodleImage large_image; | 65 DoodleImage large_image; |
| 68 DoodleImage large_cta_image; | 66 DoodleImage large_cta_image; |
| 69 DoodleImage transparent_large_image; | 67 DoodleImage transparent_large_image; |
| 70 | 68 |
| 71 // TODO(treib,fhorschig): Don't expose this? Clients don't care about it. | |
| 72 base::TimeDelta time_to_live; | |
| 73 | |
| 74 // Copying and assignment allowed. | 69 // Copying and assignment allowed. |
| 75 }; | 70 }; |
| 76 | 71 |
| 77 } // namespace doodle | 72 } // namespace doodle |
| 78 | 73 |
| 79 #endif // COMPONENTS_DOODLE_DOODLE_TYPES_H_ | 74 #endif // COMPONENTS_DOODLE_DOODLE_TYPES_H_ |
| OLD | NEW |