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

Unified Diff: ui/app_list/views/tile_item_view.cc

Issue 326023002: App list: TileItemView::SetAppListItem exits early if item already set. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test failure (TileItemView is invisible by default). Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/tile_item_view.cc
diff --git a/ui/app_list/views/tile_item_view.cc b/ui/app_list/views/tile_item_view.cc
index 583098e25cad9b879cba0a5c81e3e3b64971df96..d770e8102f5a0b8e09348460acd4c6449831a6f4 100644
--- a/ui/app_list/views/tile_item_view.cc
+++ b/ui/app_list/views/tile_item_view.cc
@@ -94,6 +94,10 @@ TileItemView::TileItemView()
title_->SetFontList(rb.GetFontList(kItemTextFontStyle));
title_->SetHorizontalAlignment(gfx::ALIGN_CENTER);
+ // When |item_| is NULL, the tile is invisible. Calling SetAppListItem with a
+ // non-NULL item makes the tile visible.
+ SetVisible(false);
Matt Giuca 2014/06/16 00:29:28 I don't think adding this actually changes any beh
+
AddChildView(icon_);
AddChildView(title_);
}
@@ -102,6 +106,12 @@ TileItemView::~TileItemView() {
}
void TileItemView::SetAppListItem(AppListItem* item) {
+ // TODO(calamity): This will not update if the contents of |item_| have
+ // changed since it was last assigned. Add an observer to refresh when the
+ // item changes.
+ if (item == item_)
+ return;
+
item_ = item;
if (!item) {
SetVisible(false);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698