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

Unified Diff: ash/shelf/shelf_view.cc

Issue 302653008: Moving default minimize location to the app launcher item. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed some comments Created 6 years, 7 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 | « ash/shelf/shelf_view.h ('k') | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/shelf_view.cc
diff --git a/ash/shelf/shelf_view.cc b/ash/shelf/shelf_view.cc
index 1cc1cf61203d2e22519615086d8dfb21a5564d52..30eae9fc1c0712a07fd8e820b2bbf3d930d003ba 100644
--- a/ash/shelf/shelf_view.cc
+++ b/ash/shelf/shelf_view.cc
@@ -454,9 +454,16 @@ void ShelfView::SchedulePaintForAllButtons() {
gfx::Rect ShelfView::GetIdealBoundsOfItemIcon(ShelfID id) {
int index = model_->ItemIndexByID(id);
- if (index == -1 || (index > last_visible_index_ &&
- index < model_->FirstPanelIndex()))
+ if (index == -1)
return gfx::Rect();
+ // Map all items from overflow area to the overflow button. Note that the
+ // section between last_index_hidden_ and model_->FirstPanelIndex() is the
+ // list of invisible panel items. However, these items are currently nowhere
+ // represented and get dropped instead - see (crbug.com/378907). As such there
+ // is no way to address them or place them. We therefore move them over the
+ // overflow button.
+ if (index > last_visible_index_ && index < model_->FirstPanelIndex())
+ index = last_visible_index_ + 1;
const gfx::Rect& ideal_bounds(view_model_->ideal_bounds(index));
DCHECK_NE(TYPE_APP_LIST, model_->items()[index].type);
ShelfButton* button = static_cast<ShelfButton*>(view_model_->view_at(index));
@@ -775,7 +782,7 @@ void ShelfView::CalculateIdealBounds(IdealBounds* bounds) {
--last_visible_index_;
for (int i = 0; i < view_model_->view_size(); ++i) {
bool visible = i <= last_visible_index_ || i > last_hidden_index_;
- // To receive drag event continously from |drag_view_| during the dragging
+ // To receive drag event continuously from |drag_view_| during the dragging
// off from the shelf, don't make |drag_view_| invisible. It will be
// eventually invisible and removed from the |view_model_| by
// FinalizeRipOffDrag().
« no previous file with comments | « ash/shelf/shelf_view.h ('k') | ash/shelf/shelf_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698