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

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

Issue 23228004: Prepare to use gfx::RenderText in views::Label. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix multiline LabelButton layout and sizing. Created 6 years, 5 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/apps_grid_view.cc
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc
index 651a5069d00c23cc92c6cc2860fd01c2a13ef0eb..ddc1337ba16ec16ce6ce23b284e194da3660aa01 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -24,6 +24,7 @@
#include "ui/events/event.h"
#include "ui/gfx/animation/animation.h"
#include "ui/views/border.h"
+#include "ui/views/controls/label.h"
#include "ui/views/view_model_utils.h"
#include "ui/views/widget/widget.h"
@@ -73,9 +74,6 @@ const int kPageFlipZoneSize = 40;
// Delay in milliseconds to do the page flip.
const int kPageFlipDelayInMs = 1000;
-// How many pages on either side of the selected one we prerender.
-const int kPrerenderPages = 1;
-
// The drag and drop proxy should get scaled by this factor.
const float kDragAndDropProxyScale = 1.5f;
@@ -837,13 +835,6 @@ void AppsGridView::SetDragAndDropHostOfCurrentAppList(
void AppsGridView::Prerender(int page_index) {
Layout();
- int start = std::max(0, (page_index - kPrerenderPages) * tiles_per_page());
- int end = std::min(view_model_.view_size(),
- (page_index + 1 + kPrerenderPages) * tiles_per_page());
- for (int i = start; i < end; i++) {
- AppListItemView* v = static_cast<AppListItemView*>(view_model_.view_at(i));
- v->Prerender();
- }
}
bool AppsGridView::IsAnimatingView(views::View* view) {
@@ -1012,8 +1003,7 @@ views::View* AppsGridView::CreateViewForItemAtIndex(size_t index) {
// The drag_view_ might be pending for deletion, therefore view_model_
// may have one more item than item_list_.
DCHECK_LE(index, item_list_->item_count());
- AppListItemView* view = new AppListItemView(this,
- item_list_->item_at(index));
+ AppListItemView* view = new AppListItemView(this, item_list_->item_at(index));
view->SetIconSize(icon_size_);
view->SetPaintToLayer(true);
view->SetFillsBoundsOpaquely(false);

Powered by Google App Engine
This is Rietveld 408576698