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

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
« no previous file with comments | « ash/launcher/launcher_view.h ('k') | ash/launcher/overflow_bubble.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
458 views::ImageButton::ALIGN_BOTTOM)); 458 views::ImageButton::ALIGN_BOTTOM));
459 } 459 }
460 if (i >= first_visible_index_ && i <= last_visible_index_) 460 if (i >= first_visible_index_ && i <= last_visible_index_)
461 view_model_->view_at(i)->Layout(); 461 view_model_->view_at(i)->Layout();
462 } 462 }
463 tooltip_->UpdateArrow(); 463 tooltip_->UpdateArrow();
464 if (overflow_bubble_) 464 if (overflow_bubble_)
465 overflow_bubble_->Hide(); 465 overflow_bubble_->Hide();
466 } 466 }
467 467
468 void LauncherView::SchedulePaintForAllButtons() {
469 for (int i = 0; i < view_model_->view_size(); ++i) {
470 if (i >= first_visible_index_ && i <= last_visible_index_)
471 view_model_->view_at(i)->SchedulePaint();
472 }
473 if (overflow_button_ && overflow_button_->visible())
474 overflow_button_->SchedulePaint();
475 }
476
468 gfx::Rect LauncherView::GetIdealBoundsOfItemIcon(LauncherID id) { 477 gfx::Rect LauncherView::GetIdealBoundsOfItemIcon(LauncherID id) {
469 int index = model_->ItemIndexByID(id); 478 int index = model_->ItemIndexByID(id);
470 if (index == -1 || (index > last_visible_index_ && 479 if (index == -1 || (index > last_visible_index_ &&
471 index < model_->FirstPanelIndex())) 480 index < model_->FirstPanelIndex()))
472 return gfx::Rect(); 481 return gfx::Rect();
473 const gfx::Rect& ideal_bounds(view_model_->ideal_bounds(index)); 482 const gfx::Rect& ideal_bounds(view_model_->ideal_bounds(index));
474 DCHECK_NE(TYPE_APP_LIST, model_->items()[index].type); 483 DCHECK_NE(TYPE_APP_LIST, model_->items()[index].type);
475 LauncherButton* button = 484 LauncherButton* button =
476 static_cast<LauncherButton*>(view_model_->view_at(index)); 485 static_cast<LauncherButton*>(view_model_->view_at(index));
477 gfx::Rect icon_bounds = button->GetIconBounds(); 486 gfx::Rect icon_bounds = button->GetIconBounds();
(...skipping 1222 matching lines...) Expand 10 before | Expand all | Expand 10 after
1700 bool LauncherView::ShouldShowTooltipForView(const views::View* view) const { 1709 bool LauncherView::ShouldShowTooltipForView(const views::View* view) const {
1701 if (view == GetAppListButtonView() && 1710 if (view == GetAppListButtonView() &&
1702 Shell::GetInstance()->GetAppListWindow()) 1711 Shell::GetInstance()->GetAppListWindow())
1703 return false; 1712 return false;
1704 const LauncherItem* item = LauncherItemForView(view); 1713 const LauncherItem* item = LauncherItemForView(view);
1705 return (!item || delegate_->ShouldShowTooltip(*item)); 1714 return (!item || delegate_->ShouldShowTooltip(*item));
1706 } 1715 }
1707 1716
1708 } // namespace internal 1717 } // namespace internal
1709 } // namespace ash 1718 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/launcher_view.h ('k') | ash/launcher/overflow_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698