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

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: fix-test 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
« no previous file with comments | « ash/shelf/overflow_bubble_view.h ('k') | ash/shelf/overflow_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b15f7b73987d2f97e1a7f55984cb1031852db07f 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);
@@ -108,6 +106,10 @@ void OverflowBubbleView::ScrollByYOffset(int y_offset) {
scroll_offset_.set_y(y);
}
+ShelfLayoutManager* OverflowBubbleView::GetShelfLayoutManager() const {
+ return shelf_view_ ? shelf_view_->shelf_layout_manager() : nullptr;
+}
+
gfx::Size OverflowBubbleView::GetPreferredSize() const {
gfx::Size preferred_size = GetContentsSize();
@@ -164,12 +166,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());
« no previous file with comments | « ash/shelf/overflow_bubble_view.h ('k') | ash/shelf/overflow_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698