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

Unified Diff: ash/shelf/overflow_bubble_view.cc

Issue 1659283002: ash: Explicitly teach various components about ShelfLayoutManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ozone-ui-event-platform-event
Patch Set: . Created 4 years, 11 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: ash/shelf/overflow_bubble_view.cc
diff --git a/ash/shelf/overflow_bubble_view.cc b/ash/shelf/overflow_bubble_view.cc
index 5273e50684bdde0e6c1e5342a97d60b663a4927c..158d74592254870b936835170b13b4b90d2c4648 100644
--- a/ash/shelf/overflow_bubble_view.cc
+++ b/ash/shelf/overflow_bubble_view.cc
@@ -41,8 +41,6 @@ OverflowBubbleView::~OverflowBubbleView() {
void OverflowBubbleView::InitOverflowBubble(views::View* anchor,
ShelfView* shelf_view) {
- // set_anchor_view needs to be called before GetShelfLayoutManager() can be
- // called.
SetAnchorView(anchor);
set_arrow(GetBubbleArrow());
set_background(NULL);
@@ -67,7 +65,8 @@ void OverflowBubbleView::InitOverflowBubble(views::View* anchor,
}
bool OverflowBubbleView::IsHorizontalAlignment() const {
- ShelfLayoutManager* shelf_layout_manager = GetShelfLayoutManager();
+ ShelfLayoutManager* shelf_layout_manager =
+ shelf_view_ ? shelf_view_->shelf_layout_manager() : nullptr;
return shelf_layout_manager ? shelf_layout_manager->IsHorizontalAlignment()
: false;
}
@@ -78,7 +77,8 @@ const gfx::Size OverflowBubbleView::GetContentsSize() const {
// Gets arrow location based on shelf alignment.
views::BubbleBorder::Arrow OverflowBubbleView::GetBubbleArrow() const {
- ShelfLayoutManager* shelf_layout_manager = GetShelfLayoutManager();
+ ShelfLayoutManager* shelf_layout_manager =
sky 2016/02/03 00:01:42 nit: keep GetShelfLayoutManager but makes it imple
sadrul 2016/02/03 02:07:58 Done.
+ shelf_view_ ? shelf_view_->shelf_layout_manager() : nullptr;
return shelf_layout_manager ?
shelf_layout_manager->SelectValueForShelfAlignment(
views::BubbleBorder::BOTTOM_LEFT,
@@ -164,12 +164,6 @@ bool OverflowBubbleView::OnMouseWheel(const ui::MouseWheelEvent& event) {
return true;
}
-ShelfLayoutManager* OverflowBubbleView::GetShelfLayoutManager() const {
- return GetAnchorView() ? ShelfLayoutManager::ForShelf(
- GetAnchorView()->GetWidget()->GetNativeView())
- : NULL;
-}
-
void OverflowBubbleView::OnScrollEvent(ui::ScrollEvent* event) {
ScrollByXOffset(-event->x_offset());
ScrollByYOffset(-event->y_offset());

Powered by Google App Engine
This is Rietveld 408576698