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

Unified Diff: ash/shelf/overflow_button.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_button.h ('k') | ash/shelf/shelf.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/shelf/overflow_button.cc
diff --git a/ash/shelf/overflow_button.cc b/ash/shelf/overflow_button.cc
index 16db6f8ff7356de5e3ae18e88e5bfe24bb585217..f338e5cdd06dfce4ebe382ce41e090df6bb8836a 100644
--- a/ash/shelf/overflow_button.cc
+++ b/ash/shelf/overflow_button.cc
@@ -5,6 +5,7 @@
#include "ash/shelf/overflow_button.h"
#include "ash/ash_switches.h"
+#include "ash/shelf/shelf.h"
#include "ash/shelf/shelf_layout_manager.h"
#include "ash/shelf/shelf_widget.h"
#include "grit/ash_resources.h"
@@ -34,8 +35,7 @@ const int kBackgroundOffset = (48 - kButtonHoverSize) / 2;
} // namesapce
-OverflowButton::OverflowButton(views::ButtonListener* listener,
- ShelfLayoutManager* shelf)
+OverflowButton::OverflowButton(views::ButtonListener* listener, Shelf* shelf)
: CustomButton(listener), bottom_image_(nullptr), shelf_(shelf) {
ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance();
bottom_image_ = rb->GetImageNamed(IDR_ASH_SHELF_OVERFLOW).ToImageSkia();
@@ -80,12 +80,10 @@ void OverflowButton::PaintBackground(gfx::Canvas* canvas, int alpha) {
}
void OverflowButton::OnPaint(gfx::Canvas* canvas) {
- ShelfAlignment alignment = shelf_->GetAlignment();
-
gfx::Rect bounds(GetContentsBounds());
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
int background_image_id = 0;
- if (shelf_->shelf_widget()->shelf()->IsShowingOverflowBubble())
+ if (shelf_->IsShowingOverflowBubble())
background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_PRESSED;
else if (shelf_->shelf_widget()->GetDimsShelf())
background_image_id = IDR_AURA_NOTIFICATION_BACKGROUND_ON_BLACK;
@@ -94,6 +92,7 @@ void OverflowButton::OnPaint(gfx::Canvas* canvas) {
const gfx::ImageSkia* background =
rb.GetImageNamed(background_image_id).ToImageSkia();
+ ShelfAlignment alignment = shelf_->alignment();
if (alignment == SHELF_ALIGNMENT_LEFT) {
bounds = gfx::Rect(
bounds.right() - background->width() -
« no previous file with comments | « ash/shelf/overflow_button.h ('k') | ash/shelf/shelf.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698