Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(744)

Side by Side Diff: ui/app_list/views/search_result_tile_item_view.cc

Issue 2954223002: Revert of Add the Play Store app search to the launcher. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/app_list/vector_icons/ic_badge_play.1x.icon ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 title()->SetFontList(base_font.DeriveWithSizeDelta(1)); 104 title()->SetFontList(base_font.DeriveWithSizeDelta(1));
105 title()->SetEnabledColor(kSearchTitleColor); 105 title()->SetEnabledColor(kSearchTitleColor);
106 } 106 }
107 } 107 }
108 108
109 // Only refresh the icon if it's different from the old one. This prevents 109 // Only refresh the icon if it's different from the old one. This prevents
110 // flickering. 110 // flickering.
111 if (!old_item || !item->icon().BackedBySameObjectAs(old_item->icon())) { 111 if (!old_item || !item->icon().BackedBySameObjectAs(old_item->icon())) {
112 OnIconChanged(); 112 OnIconChanged();
113 } 113 }
114 if (!old_item ||
115 !item->badge_icon().BackedBySameObjectAs(old_item->badge_icon())) {
116 OnBadgeIconChanged();
117 }
118 } 114 }
119 115
120 void SearchResultTileItemView::SetRating(float rating) { 116 void SearchResultTileItemView::SetRating(float rating) {
121 if (!rating_) 117 if (!rating_)
122 return; 118 return;
123 119
124 if (rating < 0) { 120 if (rating < 0) {
125 rating_->SetVisible(false); 121 rating_->SetVisible(false);
126 return; 122 return;
127 } 123 }
(...skipping 24 matching lines...) Expand all
152 if (event.key_code() == ui::VKEY_RETURN) { 148 if (event.key_code() == ui::VKEY_RETURN) {
153 view_delegate_->OpenSearchResult(item_, false, event.flags()); 149 view_delegate_->OpenSearchResult(item_, false, event.flags());
154 return true; 150 return true;
155 } 151 }
156 152
157 return false; 153 return false;
158 } 154 }
159 155
160 void SearchResultTileItemView::OnIconChanged() { 156 void SearchResultTileItemView::OnIconChanged() {
161 SetIcon(item_->icon()); 157 SetIcon(item_->icon());
162 Layout();
163 } 158 }
164 159
165 void SearchResultTileItemView::OnBadgeIconChanged() { 160 void SearchResultTileItemView::OnBadgeIconChanged() {
166 SetBadgeIcon(item_->badge_icon()); 161 SetBadgeIcon(item_->badge_icon());
167 Layout();
168 } 162 }
169 163
170 void SearchResultTileItemView::OnRatingChanged() { 164 void SearchResultTileItemView::OnRatingChanged() {
171 SetRating(item_->rating()); 165 SetRating(item_->rating());
172 } 166 }
173 167
174 void SearchResultTileItemView::OnFormattedPriceChanged() { 168 void SearchResultTileItemView::OnFormattedPriceChanged() {
175 SetPrice(item_->formatted_price()); 169 SetPrice(item_->formatted_price());
176 } 170 }
177 171
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 if (item_->display_type() == SearchResult::DISPLAY_RECOMMENDATION) 260 if (item_->display_type() == SearchResult::DISPLAY_RECOMMENDATION)
267 return gfx::Size(kGridTileWidth, kGridTileHeight); 261 return gfx::Size(kGridTileWidth, kGridTileHeight);
268 if (item_->display_type() == SearchResult::DISPLAY_TILE) 262 if (item_->display_type() == SearchResult::DISPLAY_TILE)
269 return gfx::Size(kSearchTileWidth, kSearchTileHeight); 263 return gfx::Size(kSearchTileWidth, kSearchTileHeight);
270 } 264 }
271 265
272 return TileItemView::CalculatePreferredSize(); 266 return TileItemView::CalculatePreferredSize();
273 } 267 }
274 268
275 } // namespace app_list 269 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/vector_icons/ic_badge_play.1x.icon ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698