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

Unified Diff: ash/shelf/overflow_bubble_view.cc

Issue 2867413002: [ash-md] Updated the overflow shelf to change colors based on the wallpaper. (Closed)
Patch Set: Added ShelfViewTest.OverflowShelfColorIsDerivedFromWallpaper test. Created 3 years, 7 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/shelf_background_animator_unittest.cc » ('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 361e6801963e5633ad4b7b9f4fed20d81270912c..de00f21b0192f5b0c192666118b3b66b22ed3ad6 100644
--- a/ash/shelf/overflow_bubble_view.cc
+++ b/ash/shelf/overflow_bubble_view.cc
@@ -10,6 +10,7 @@
#include "ash/root_window_controller.h"
#include "ash/shelf/shelf_constants.h"
#include "ash/shelf/wm_shelf.h"
+#include "ash/shell.h"
#include "ash/wm_window.h"
#include "base/i18n/rtl.h"
#include "ui/display/display.h"
@@ -29,17 +30,24 @@ const int kEndPadding = 16;
// Distance between overflow bubble and the main shelf.
const int kDistanceToMainShelf = 4;
-constexpr SkColor kBackgroundColor =
- SkColorSetA(kShelfDefaultBaseColor, kShelfTranslucentAlpha);
-
} // namespace
OverflowBubbleView::OverflowBubbleView(WmShelf* wm_shelf)
- : wm_shelf_(wm_shelf), shelf_view_(nullptr) {
+ : wm_shelf_(wm_shelf),
+ shelf_view_(nullptr),
+ background_animator_(SHELF_BACKGROUND_OVERLAP,
+ // Don't pass the WmShelf so the translucent color is
+ // always used.
+ nullptr,
+ Shell::Get()->wallpaper_controller()) {
DCHECK(wm_shelf_);
+
+ background_animator_.AddObserver(this);
}
-OverflowBubbleView::~OverflowBubbleView() {}
+OverflowBubbleView::~OverflowBubbleView() {
+ background_animator_.RemoveObserver(this);
+}
void OverflowBubbleView::InitOverflowBubble(views::View* anchor,
views::View* shelf_view) {
@@ -48,7 +56,6 @@ void OverflowBubbleView::InitOverflowBubble(views::View* anchor,
SetAnchorView(anchor);
set_arrow(views::BubbleBorder::NONE);
set_background(nullptr);
- set_color(kBackgroundColor);
if (wm_shelf_->IsHorizontalAlignment())
set_margins(gfx::Insets(0, kEndPadding));
else
@@ -197,4 +204,8 @@ gfx::Rect OverflowBubbleView::GetBubbleBounds() {
return bounds;
}
+void OverflowBubbleView::UpdateShelfBackground(SkColor color) {
+ set_color(color);
+}
+
} // namespace ash
« no previous file with comments | « ash/shelf/overflow_bubble_view.h ('k') | ash/shelf/shelf_background_animator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698