OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/app_list/views/search_result_tile_item_view.h" | 5 #include "ui/app_list/views/search_result_tile_item_view.h" |
6 | 6 |
7 #include "base/i18n/number_formatting.h" | 7 #include "base/i18n/number_formatting.h" |
8 #include "ui/app_list/app_list_constants.h" | 8 #include "ui/app_list/app_list_constants.h" |
9 #include "ui/app_list/app_list_features.h" | 9 #include "ui/app_list/app_list_features.h" |
10 #include "ui/app_list/app_list_view_delegate.h" | 10 #include "ui/app_list/app_list_view_delegate.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 if (event.key_code() == ui::VKEY_RETURN) { | 149 if (event.key_code() == ui::VKEY_RETURN) { |
150 view_delegate_->OpenSearchResult(item_, false, event.flags()); | 150 view_delegate_->OpenSearchResult(item_, false, event.flags()); |
151 return true; | 151 return true; |
152 } | 152 } |
153 | 153 |
154 return false; | 154 return false; |
155 } | 155 } |
156 | 156 |
157 void SearchResultTileItemView::OnIconChanged() { | 157 void SearchResultTileItemView::OnIconChanged() { |
158 SetIcon(item_->icon()); | 158 SetIcon(item_->icon()); |
| 159 Layout(); |
159 } | 160 } |
160 | 161 |
161 void SearchResultTileItemView::OnBadgeIconChanged() { | 162 void SearchResultTileItemView::OnBadgeIconChanged() { |
162 SetBadgeIcon(item_->badge_icon()); | 163 SetBadgeIcon(item_->badge_icon()); |
| 164 Layout(); |
163 } | 165 } |
164 | 166 |
165 void SearchResultTileItemView::OnRatingChanged() { | 167 void SearchResultTileItemView::OnRatingChanged() { |
166 SetRating(item_->rating()); | 168 SetRating(item_->rating()); |
167 } | 169 } |
168 | 170 |
169 void SearchResultTileItemView::OnFormattedPriceChanged() { | 171 void SearchResultTileItemView::OnFormattedPriceChanged() { |
170 SetPrice(item_->formatted_price()); | 172 SetPrice(item_->formatted_price()); |
171 } | 173 } |
172 | 174 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 if (item_->display_type() == SearchResult::DISPLAY_RECOMMENDATION) | 263 if (item_->display_type() == SearchResult::DISPLAY_RECOMMENDATION) |
262 return gfx::Size(kGridTileWidth, kGridTileHeight); | 264 return gfx::Size(kGridTileWidth, kGridTileHeight); |
263 if (item_->display_type() == SearchResult::DISPLAY_TILE) | 265 if (item_->display_type() == SearchResult::DISPLAY_TILE) |
264 return gfx::Size(kSearchTileWidth, kSearchTileHeight); | 266 return gfx::Size(kSearchTileWidth, kSearchTileHeight); |
265 } | 267 } |
266 | 268 |
267 return TileItemView::CalculatePreferredSize(); | 269 return TileItemView::CalculatePreferredSize(); |
268 } | 270 } |
269 | 271 |
270 } // namespace app_list | 272 } // namespace app_list |
OLD | NEW |