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

Side by Side 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, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ 5 #ifndef ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_
6 #define ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ 6 #define ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ash/common/login_status.h" 9 #include "ash/common/login_status.h"
10 #include "ash/common/shelf/shelf_types.h" 10 #include "ash/common/shelf/shelf_types.h"
11 #include "ash/common/system/view_observer.h"
11 #include "base/macros.h" 12 #include "base/macros.h"
12 #include "ui/views/widget/widget.h" 13 #include "ui/views/widget/widget.h"
13 14
14 namespace ash { 15 namespace ash {
15 class OverviewButtonTray; 16 class OverviewButtonTray;
16 class ShellDelegate; 17 class ShellDelegate;
17 class StatusAreaWidgetDelegate; 18 class StatusAreaWidgetDelegate;
18 class SystemTray; 19 class SystemTray;
20 class TrayBackgroundView;
19 class WebNotificationTray; 21 class WebNotificationTray;
20 class WmShelf; 22 class WmShelf;
21 class WmWindow; 23 class WmWindow;
22 #if defined(OS_CHROMEOS) 24 #if defined(OS_CHROMEOS)
23 class ImeMenuTray; 25 class ImeMenuTray;
24 class LogoutButtonTray; 26 class LogoutButtonTray;
25 class PaletteTray; 27 class PaletteTray;
26 class VirtualKeyboardTray; 28 class VirtualKeyboardTray;
27 #endif 29 #endif
28 30
29 class ASH_EXPORT StatusAreaWidget : public views::Widget { 31 class ASH_EXPORT StatusAreaWidget : public views::Widget, public ViewObserver {
30 public: 32 public:
31 StatusAreaWidget(WmWindow* status_container, WmShelf* wm_shelf); 33 StatusAreaWidget(WmWindow* status_container, WmShelf* wm_shelf);
32 ~StatusAreaWidget() override; 34 ~StatusAreaWidget() override;
33 35
34 // Creates the SystemTray, WebNotificationTray and LogoutButtonTray. 36 // Creates the SystemTray, WebNotificationTray and LogoutButtonTray.
35 void CreateTrayViews(); 37 void CreateTrayViews();
36 38
37 // Destroys the system tray and web notification tray. Called before 39 // Destroys the system tray and web notification tray. Called before
38 // tearing down the windows to avoid shutdown ordering issues. 40 // tearing down the windows to avoid shutdown ordering issues.
39 void Shutdown(); 41 void Shutdown();
(...skipping 28 matching lines...) Expand all
68 70
69 // Notifies child trays, and the |status_area_widget_delegate_| to schedule a 71 // Notifies child trays, and the |status_area_widget_delegate_| to schedule a
70 // paint. 72 // paint.
71 void SchedulePaint(); 73 void SchedulePaint();
72 74
73 // Overridden from views::Widget: 75 // Overridden from views::Widget:
74 void OnNativeWidgetActivationChanged(bool active) override; 76 void OnNativeWidgetActivationChanged(bool active) override;
75 void OnMouseEvent(ui::MouseEvent* event) override; 77 void OnMouseEvent(ui::MouseEvent* event) override;
76 void OnGestureEvent(ui::GestureEvent* event) override; 78 void OnGestureEvent(ui::GestureEvent* event) override;
77 79
80 // Based on visibility of |tray| and tray item on its right, it sets |tray|'s
81 // visibility of the separator either to true or false. Note that no leading
82 // separator is required before the |logout_button_tray_| because that
83 // button's red background is distinctive on its own.
84 void OnVisibilityChange(TrayBackgroundView* tray) override;
85
78 private: 86 private:
79 void AddSystemTray(); 87 void AddSystemTray();
80 void AddWebNotificationTray(); 88 void AddWebNotificationTray();
81 #if defined(OS_CHROMEOS) 89 #if defined(OS_CHROMEOS)
82 void AddLogoutButtonTray(); 90 void AddLogoutButtonTray();
83 void AddPaletteTray(); 91 void AddPaletteTray();
84 void AddVirtualKeyboardTray(); 92 void AddVirtualKeyboardTray();
85 void AddImeMenuTray(); 93 void AddImeMenuTray();
86 #endif 94 #endif
87 void AddOverviewButtonTray(); 95 void AddOverviewButtonTray();
(...skipping 12 matching lines...) Expand all
100 LoginStatus login_status_; 108 LoginStatus login_status_;
101 109
102 WmShelf* wm_shelf_; 110 WmShelf* wm_shelf_;
103 111
104 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); 112 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget);
105 }; 113 };
106 114
107 } // namespace ash 115 } // namespace ash
108 116
109 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ 117 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698