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

Side by Side Diff: ash/launcher/launcher_view.cc

Issue 22527003: ash:Shelf Overflow Button (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/launcher/launcher_view.h" 5 #include "ash/launcher/launcher_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/ash_constants.h" 9 #include "ash/ash_constants.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 views::ImageButton::ALIGN_BOTTOM)); 459 views::ImageButton::ALIGN_BOTTOM));
460 } 460 }
461 if (i >= first_visible_index_ && i <= last_visible_index_) 461 if (i >= first_visible_index_ && i <= last_visible_index_)
462 view_model_->view_at(i)->Layout(); 462 view_model_->view_at(i)->Layout();
463 } 463 }
464 tooltip_->UpdateArrow(); 464 tooltip_->UpdateArrow();
465 if (overflow_bubble_) 465 if (overflow_bubble_)
466 overflow_bubble_->Hide(); 466 overflow_bubble_->Hide();
467 } 467 }
468 468
469 void LauncherView::SchedulePaintForAllButtons() {
470 for (int i=0; i >= first_visible_index_ && i <= last_visible_index_; ++i)
James Cook 2013/08/07 18:23:13 spaces around =, and should i start at first_visib
Harry McCleave 2013/08/07 22:50:59 Spacing done, first_visible_index and last_visible
James Cook 2013/08/07 23:22:05 Much easier to understand, thanks.
471 view_model_->view_at(i)->SchedulePaint();
472 if (overflow_button_ && overflow_button_->visible())
473 overflow_button_->SchedulePaint();
474 }
475
469 gfx::Rect LauncherView::GetIdealBoundsOfItemIcon(LauncherID id) { 476 gfx::Rect LauncherView::GetIdealBoundsOfItemIcon(LauncherID id) {
470 int index = model_->ItemIndexByID(id); 477 int index = model_->ItemIndexByID(id);
471 if (index == -1 || (index > last_visible_index_ && 478 if (index == -1 || (index > last_visible_index_ &&
472 index < model_->FirstPanelIndex())) 479 index < model_->FirstPanelIndex()))
473 return gfx::Rect(); 480 return gfx::Rect();
474 const gfx::Rect& ideal_bounds(view_model_->ideal_bounds(index)); 481 const gfx::Rect& ideal_bounds(view_model_->ideal_bounds(index));
475 DCHECK_NE(TYPE_APP_LIST, model_->items()[index].type); 482 DCHECK_NE(TYPE_APP_LIST, model_->items()[index].type);
476 LauncherButton* button = 483 LauncherButton* button =
477 static_cast<LauncherButton*>(view_model_->view_at(index)); 484 static_cast<LauncherButton*>(view_model_->view_at(index));
478 gfx::Rect icon_bounds = button->GetIconBounds(); 485 gfx::Rect icon_bounds = button->GetIconBounds();
(...skipping 1227 matching lines...) Expand 10 before | Expand all | Expand 10 after
1706 bool LauncherView::ShouldShowTooltipForView(const views::View* view) const { 1713 bool LauncherView::ShouldShowTooltipForView(const views::View* view) const {
1707 if (view == GetAppListButtonView() && 1714 if (view == GetAppListButtonView() &&
1708 Shell::GetInstance()->GetAppListWindow()) 1715 Shell::GetInstance()->GetAppListWindow())
1709 return false; 1716 return false;
1710 const LauncherItem* item = LauncherItemForView(view); 1717 const LauncherItem* item = LauncherItemForView(view);
1711 return (!item || delegate_->ShouldShowTooltip(*item)); 1718 return (!item || delegate_->ShouldShowTooltip(*item));
1712 } 1719 }
1713 1720
1714 } // namespace internal 1721 } // namespace internal
1715 } // namespace ash 1722 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698