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

Unified Diff: ui/app_list/views/search_result_tile_item_view.h

Issue 2949733002: Show Play Store rating and price in app list (Closed)
Patch Set: Apply fix to patch set 5 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 side-by-side diff with in-line comments
Download patch
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_;
« no previous file with comments | « ui/app_list/views/search_result_tile_item_list_view.cc ('k') | ui/app_list/views/search_result_tile_item_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698