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

Unified Diff: ash/common/system/status_area_widget.h

Issue 2147143002: [Chrome OS MD] Draw a 1px separator between 2 tray items (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: new approach Created 4 years, 5 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/status_area_widget.h
diff --git a/ash/common/system/status_area_widget.h b/ash/common/system/status_area_widget.h
index 550555f7370f7d582aeb9ba477fa5ea9079a5dcc..fd5875b176460d62d8a78fb88fb66a238a1107ba 100644
--- a/ash/common/system/status_area_widget.h
+++ b/ash/common/system/status_area_widget.h
@@ -8,6 +8,7 @@
#include "ash/ash_export.h"
#include "ash/common/login_status.h"
#include "ash/common/shelf/shelf_types.h"
+#include "ash/common/system/view_observer.h"
#include "base/macros.h"
#include "ui/views/widget/widget.h"
@@ -16,6 +17,7 @@ class OverviewButtonTray;
class ShellDelegate;
class StatusAreaWidgetDelegate;
class SystemTray;
+class TrayBackgroundView;
class WebNotificationTray;
class WmShelf;
class WmWindow;
@@ -26,7 +28,7 @@ class PaletteTray;
class VirtualKeyboardTray;
#endif
-class ASH_EXPORT StatusAreaWidget : public views::Widget {
+class ASH_EXPORT StatusAreaWidget : public views::Widget, public ViewObserver {
public:
StatusAreaWidget(WmWindow* status_container, WmShelf* wm_shelf);
~StatusAreaWidget() override;
@@ -75,6 +77,12 @@ class ASH_EXPORT StatusAreaWidget : public views::Widget {
void OnMouseEvent(ui::MouseEvent* event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
+ // Based on visibility of |tray| and tray item on its right, it sets |tray|'s
+ // visibility of the separator either to true or false. Note that no leading
+ // separator is required before the |logout_button_tray_| because that
+ // button's red background is distinctive on its own.
+ void OnVisibilityChange(TrayBackgroundView* tray) override;
+
private:
void AddSystemTray();
void AddWebNotificationTray();

Powered by Google App Engine
This is Rietveld 408576698