Index: ui/app_list/views/search_result_tile_item_view.h |
diff --git a/ui/app_list/views/search_result_tile_item_view.h b/ui/app_list/views/search_result_tile_item_view.h |
index 3f5ff19fe4083c32a2f2186e685041435dc2b60c..17e40f4dc8fb6a8c9ec85dfa2e68a433855219cb 100644 |
--- a/ui/app_list/views/search_result_tile_item_view.h |
+++ b/ui/app_list/views/search_result_tile_item_view.h |
@@ -12,6 +12,7 @@ |
namespace views { |
class MenuRunner; |
+class Label; |
} |
namespace app_list { |
@@ -40,6 +41,8 @@ class APP_LIST_EXPORT SearchResultTileItemView |
// Overridden from SearchResultObserver: |
void OnIconChanged() override; |
void OnBadgeIconChanged() override; |
+ void OnRatingChanged() override; |
+ void OnFormattedPriceChanged() override; |
void OnResultDestroying() override; |
// views::ContextMenuController overrides: |
@@ -48,6 +51,13 @@ class APP_LIST_EXPORT SearchResultTileItemView |
ui::MenuSourceType source_type) override; |
private: |
+ // Shows rating in proper format if |rating| is not negative. Otherwise, hides |
+ // the rating label. |
+ void SetRating(float rating); |
+ |
+ // Shows price if |price| is not empty. Otherwise, hides the price label. |
+ void SetPrice(const base::string16& price); |
+ |
// Overridden from views::View: |
void Layout() override; |
gfx::Size CalculatePreferredSize() const override; |
@@ -55,7 +65,10 @@ class APP_LIST_EXPORT SearchResultTileItemView |
SearchResultContainerView* result_container_; // Parent view |
// Owned by the model provided by the AppListViewDelegate. |
- SearchResult* item_; |
+ SearchResult* item_ = nullptr; |
+ |
+ views::Label* rating_ = nullptr; // Owned by views hierarchy. |
+ views::Label* price_ = nullptr; // Owned by views hierarchy. |
AppListViewDelegate* view_delegate_; |