OLD | NEW |
---|---|
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 CHROME_COMMON_INSTANT_TYPES_H_ | 5 #ifndef CHROME_COMMON_INSTANT_TYPES_H_ |
6 #define CHROME_COMMON_INSTANT_TYPES_H_ | 6 #define CHROME_COMMON_INSTANT_TYPES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
149 // The theme background image tiling is only valid if |theme_id| is valid. | 149 // The theme background image tiling is only valid if |theme_id| is valid. |
150 ThemeBackgroundImageTiling image_tiling; | 150 ThemeBackgroundImageTiling image_tiling; |
151 | 151 |
152 // The theme background image height. | 152 // The theme background image height. |
153 // Value is only valid if |theme_id| is valid. | 153 // Value is only valid if |theme_id| is valid. |
154 uint16 image_height; | 154 uint16 image_height; |
155 | 155 |
156 // True if theme has attribution logo. | 156 // True if theme has attribution logo. |
157 // Value is only valid if |theme_id| is valid. | 157 // Value is only valid if |theme_id| is valid. |
158 bool has_attribution; | 158 bool has_attribution; |
159 | |
160 bool operator==(const ThemeBackgroundInfo& other) const { | |
samarth
2013/05/03 21:24:42
Don't overload operators please. Just add a helpe
| |
161 return color_r == other.color_r && | |
162 color_g == other.color_g && | |
163 color_b == other.color_b && | |
164 color_a == other.color_a && | |
165 theme_id == other.theme_id && | |
166 image_horizontal_alignment == other.image_horizontal_alignment && | |
167 image_vertical_alignment == other.image_vertical_alignment && | |
168 image_tiling == other.image_tiling && | |
169 image_height == other.image_height && | |
170 has_attribution == other.has_attribution; | |
171 } | |
172 | |
173 bool operator!=(const ThemeBackgroundInfo& other) const { | |
174 return color_r != other.color_r || | |
175 color_g != other.color_g || | |
176 color_b != other.color_b || | |
177 color_a != other.color_a || | |
178 theme_id != other.theme_id || | |
179 image_horizontal_alignment != other.image_horizontal_alignment || | |
180 image_vertical_alignment != other.image_vertical_alignment || | |
181 image_tiling != other.image_tiling || | |
182 image_height != other.image_height || | |
183 has_attribution != other.has_attribution; | |
184 } | |
159 }; | 185 }; |
160 | 186 |
161 struct InstantMostVisitedItem { | 187 struct InstantMostVisitedItem { |
162 // The URL of the Most Visited item. | 188 // The URL of the Most Visited item. |
163 GURL url; | 189 GURL url; |
164 | 190 |
165 // The title of the Most Visited page. May be empty, in which case the |url| | 191 // The title of the Most Visited page. May be empty, in which case the |url| |
166 // is used as the title. | 192 // is used as the title. |
167 string16 title; | 193 string16 title; |
168 }; | 194 }; |
169 | 195 |
170 // An InstantMostVisitedItem along with its assigned restricted ID. | 196 // An InstantMostVisitedItem along with its assigned restricted ID. |
171 typedef std::pair<InstantRestrictedID, InstantMostVisitedItem> | 197 typedef std::pair<InstantRestrictedID, InstantMostVisitedItem> |
172 InstantMostVisitedItemIDPair; | 198 InstantMostVisitedItemIDPair; |
173 | 199 |
174 #endif // CHROME_COMMON_INSTANT_TYPES_H_ | 200 #endif // CHROME_COMMON_INSTANT_TYPES_H_ |
OLD | NEW |