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

Unified Diff: ash/common/system/tray/tray_background_view.cc

Issue 2618383003: Remove the extra separator appears on the right side of the shelf (Closed)
Patch Set: Created 3 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/common/system/tray/tray_background_view.cc
diff --git a/ash/common/system/tray/tray_background_view.cc b/ash/common/system/tray/tray_background_view.cc
index 3da2d1b35243478513dce07313447ed283c80ac6..ca31e2acd8e358e286cb1bd5af5372ba6df0b7f5 100644
--- a/ash/common/system/tray/tray_background_view.cc
+++ b/ash/common/system/tray/tray_background_view.cc
@@ -291,6 +291,7 @@ TrayBackgroundView::TrayBackgroundView(WmShelf* wm_shelf)
shelf_alignment_(SHELF_ALIGNMENT_BOTTOM),
background_(NULL),
is_active_(false),
+ is_separator_visible_(true),
widget_observer_(new TrayWidgetObserver(this)) {
DCHECK(wm_shelf_);
set_notify_enter_exit_on_child(true);
@@ -520,6 +521,13 @@ void TrayBackgroundView::UpdateShelfItemBackground(int alpha) {
}
}
+void TrayBackgroundView::SetSeparatorVisibility(bool is_shown) {
James Cook 2017/01/09 23:50:53 nit: whatever you choose in the header, make sure
yiyix 2017/01/10 01:02:53 Done.
+ if (is_separator_visible_ == is_shown)
+ return;
+ is_separator_visible_ = is_shown;
+ SchedulePaint();
James Cook 2017/01/09 23:50:53 Is this needed? The two places you call SetSeparat
yiyix 2017/01/10 01:02:53 I don't need SchedulePaint() now. I was thinking h
+}
+
views::View* TrayBackgroundView::GetBubbleAnchor() const {
return tray_container_;
}
@@ -581,7 +589,8 @@ void TrayBackgroundView::OnPaint(gfx::Canvas* canvas) {
ActionableView::OnPaint(canvas);
if (!MaterialDesignController::IsShelfMaterial() ||
shelf()->GetBackgroundType() ==
- ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT) {
+ ShelfBackgroundType::SHELF_BACKGROUND_DEFAULT ||
+ !is_separator_visible_) {
return;
}
// In the given |canvas|, for a horizontal shelf draw a separator line to the

Powered by Google App Engine
This is Rietveld 408576698