| Index: chrome/common/instant_types.cc
|
| diff --git a/chrome/common/instant_types.cc b/chrome/common/instant_types.cc
|
| index 1817faa49f26da71b8b0462ef78f80abe7cdd52c..e0ebfd1c3880a383a7cd7fa3c907139e5a05df0f 100644
|
| --- a/chrome/common/instant_types.cc
|
| +++ b/chrome/common/instant_types.cc
|
| @@ -34,16 +34,56 @@ InstantAutocompleteResult::~InstantAutocompleteResult() {
|
| }
|
|
|
| ThemeBackgroundInfo::ThemeBackgroundInfo()
|
| - : color_r(0),
|
| - color_g(0),
|
| - color_b(0),
|
| - color_a(0),
|
| - image_horizontal_alignment(THEME_BKGRND_IMAGE_ALIGN_CENTER),
|
| - image_vertical_alignment(THEME_BKGRND_IMAGE_ALIGN_CENTER),
|
| - image_tiling(THEME_BKGRND_IMAGE_NO_REPEAT),
|
| + : color_r(-1),
|
| + color_g(-1),
|
| + color_b(-1),
|
| + color_a(-1),
|
| + image_horizontal_alignment(THEME_BKGRND_INVALID_ALIGNMENT),
|
| + image_vertical_alignment(THEME_BKGRND_INVALID_ALIGNMENT),
|
| + image_tiling(THEME_BKGRND_INVALID_REPEAT),
|
| image_height(0),
|
| has_attribution(false) {
|
| }
|
|
|
| ThemeBackgroundInfo::~ThemeBackgroundInfo() {
|
| }
|
| +
|
| +void ThemeBackgroundInfo::Initialize() {
|
| + color_r = 0;
|
| + color_g = 0;
|
| + color_b = 0;
|
| + color_a = 0;
|
| + theme_id = std::string();
|
| + image_horizontal_alignment = THEME_BKGRND_IMAGE_ALIGN_CENTER;
|
| + image_vertical_alignment = THEME_BKGRND_IMAGE_ALIGN_CENTER;
|
| + image_tiling = THEME_BKGRND_IMAGE_NO_REPEAT;
|
| + image_height = 0;
|
| + has_attribution = false;
|
| +}
|
| +
|
| +bool ThemeBackgroundInfo::IsValid() const {
|
| + bool valid_image_details =
|
| + image_horizontal_alignment != THEME_BKGRND_INVALID_ALIGNMENT &&
|
| + image_vertical_alignment != THEME_BKGRND_INVALID_ALIGNMENT &&
|
| + image_tiling != THEME_BKGRND_INVALID_REPEAT &&
|
| + image_height > 0;
|
| +
|
| + return color_r >= 0 && color_r <= 255 &&
|
| + color_g >= 0 && color_r <= 255 &&
|
| + color_b >= 0 && color_b <= 255 &&
|
| + color_a >= 0 && color_a <= 255 &&
|
| + (theme_id.empty() ^ valid_image_details);
|
| +}
|
| +
|
| +bool ThemeBackgroundInfo::operator==(const ThemeBackgroundInfo& rhs) const {
|
| + return color_r == rhs.color_r &&
|
| + color_g == rhs.color_g &&
|
| + color_b == rhs.color_b &&
|
| + color_a == rhs.color_a &&
|
| + theme_id == rhs.theme_id &&
|
| + image_horizontal_alignment == rhs.image_horizontal_alignment &&
|
| + image_vertical_alignment == rhs.image_vertical_alignment &&
|
| + image_tiling == rhs.image_tiling &&
|
| + image_height == rhs.image_height &&
|
| + has_attribution == rhs.has_attribution;
|
| +}
|
|
|