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

Unified Diff: ash/shelf/overflow_bubble_view.cc

Issue 1743493002: Cleanup ash shelf accessor functions. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert ash/shelf/shelf_widget.cc for browser_tests crash... Created 4 years, 10 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 b15f7b73987d2f97e1a7f55984cb1031852db07f..d98282015bd3b370dcefead647ec89963b58206d 100644
--- a/ash/shelf/overflow_bubble_view.cc
+++ b/ash/shelf/overflow_bubble_view.cc
@@ -7,8 +7,8 @@
#include <algorithm>
#include "ash/root_window_controller.h"
+#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_constants.h"
-#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_view.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
@@ -32,12 +32,9 @@ const int kShelfViewLeadingInset = 8;
} // namespace
-OverflowBubbleView::OverflowBubbleView()
- : shelf_view_(NULL) {
-}
+OverflowBubbleView::OverflowBubbleView() : shelf_view_(NULL) {}
-OverflowBubbleView::~OverflowBubbleView() {
-}
+OverflowBubbleView::~OverflowBubbleView() {}
void OverflowBubbleView::InitOverflowBubble(views::View* anchor,
ShelfView* shelf_view) {
@@ -65,9 +62,7 @@ void OverflowBubbleView::InitOverflowBubble(views::View* anchor,
}
bool OverflowBubbleView::IsHorizontalAlignment() const {
- ShelfLayoutManager* shelf_layout_manager = GetShelfLayoutManager();
- return shelf_layout_manager ? shelf_layout_manager->IsHorizontalAlignment()
- : false;
+ return shelf_view_ ? shelf_view_->shelf()->IsHorizontalAlignment() : false;
}
const gfx::Size OverflowBubbleView::GetContentsSize() const {
@@ -76,14 +71,11 @@ const gfx::Size OverflowBubbleView::GetContentsSize() const {
// Gets arrow location based on shelf alignment.
views::BubbleBorder::Arrow OverflowBubbleView::GetBubbleArrow() const {
- ShelfLayoutManager* shelf_layout_manager = GetShelfLayoutManager();
- return shelf_layout_manager ?
- shelf_layout_manager->SelectValueForShelfAlignment(
- views::BubbleBorder::BOTTOM_LEFT,
- views::BubbleBorder::LEFT_TOP,
- views::BubbleBorder::RIGHT_TOP,
- views::BubbleBorder::TOP_LEFT) :
- views::BubbleBorder::NONE;
+ if (!shelf_view_)
+ return views::BubbleBorder::NONE;
+ return shelf_view_->shelf()->SelectValueForShelfAlignment(
+ views::BubbleBorder::BOTTOM_LEFT, views::BubbleBorder::LEFT_TOP,
+ views::BubbleBorder::RIGHT_TOP, views::BubbleBorder::TOP_LEFT);
}
void OverflowBubbleView::ScrollByXOffset(int x_offset) {
@@ -106,10 +98,6 @@ 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();
« 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