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

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: merge 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_background_animator_observer.h" 10 #include "ash/common/shelf/shelf_background_animator_observer.h"
11 #include "ash/common/shelf/shelf_types.h" 11 #include "ash/common/shelf/shelf_types.h"
12 #include "ash/common/shelf/wm_shelf_observer.h"
12 #include "base/macros.h" 13 #include "base/macros.h"
13 #include "ui/views/widget/widget.h" 14 #include "ui/views/widget/widget.h"
14 15
15 namespace ash { 16 namespace ash {
16 class OverviewButtonTray; 17 class OverviewButtonTray;
17 class ShellDelegate; 18 class ShellDelegate;
18 class StatusAreaWidgetDelegate; 19 class StatusAreaWidgetDelegate;
19 class SystemTray; 20 class SystemTray;
21 class TrayBackgroundView;
20 class WebNotificationTray; 22 class WebNotificationTray;
21 class WmShelf; 23 class WmShelf;
22 class WmWindow; 24 class WmWindow;
23 #if defined(OS_CHROMEOS) 25 #if defined(OS_CHROMEOS)
24 class ImeMenuTray; 26 class ImeMenuTray;
25 class LogoutButtonTray; 27 class LogoutButtonTray;
26 class PaletteTray; 28 class PaletteTray;
27 class VirtualKeyboardTray; 29 class VirtualKeyboardTray;
28 #endif 30 #endif
29 31
30 class ASH_EXPORT StatusAreaWidget : public views::Widget, 32 class ASH_EXPORT StatusAreaWidget : public views::Widget,
31 public ShelfBackgroundAnimatorObserver { 33 public ShelfBackgroundAnimatorObserver,
34 public WmShelfObserver {
32 public: 35 public:
33 StatusAreaWidget(WmWindow* status_container, WmShelf* wm_shelf); 36 StatusAreaWidget(WmWindow* status_container, WmShelf* wm_shelf);
34 ~StatusAreaWidget() override; 37 ~StatusAreaWidget() override;
35 38
36 // Creates the SystemTray, WebNotificationTray and LogoutButtonTray. 39 // Creates the SystemTray, WebNotificationTray and LogoutButtonTray.
37 void CreateTrayViews(); 40 void CreateTrayViews();
38 41
39 // Destroys the system tray and web notification tray. Called before 42 // Destroys the system tray and web notification tray. Called before
40 // tearing down the windows to avoid shutdown ordering issues. 43 // tearing down the windows to avoid shutdown ordering issues.
41 void Shutdown(); 44 void Shutdown();
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 void SchedulePaint(); 81 void SchedulePaint();
79 82
80 // Overridden from views::Widget: 83 // Overridden from views::Widget:
81 void OnNativeWidgetActivationChanged(bool active) override; 84 void OnNativeWidgetActivationChanged(bool active) override;
82 void OnMouseEvent(ui::MouseEvent* event) override; 85 void OnMouseEvent(ui::MouseEvent* event) override;
83 void OnGestureEvent(ui::GestureEvent* event) override; 86 void OnGestureEvent(ui::GestureEvent* event) override;
84 87
85 // ShelfBackgroundAnimatorObserver: 88 // ShelfBackgroundAnimatorObserver:
86 void UpdateShelfItemBackground(int alpha) override; 89 void UpdateShelfItemBackground(int alpha) override;
87 90
91 // Based on visibility of |tray| and tray item on its right, it sets |tray|'s
varkha 2016/08/10 23:27:24 nit: remove "it" (in "it sets |tray|'s ...").
yiyix 2016/08/11 01:23:18 Done.
92 // visibility of the separator either to true or false. Note that no leading
93 // separator is required before the |logout_button_tray_| because that
94 // button's red background is distinctive on its own.
95 void OnVisibilityChange(TrayBackgroundView* tray) override;
James Cook 2016/08/09 00:25:17 nit: put "WmShelfObserver:" above this line and mo
yiyix 2016/08/11 01:23:19 Done.
96
88 private: 97 private:
89 void AddSystemTray(); 98 void AddSystemTray();
90 void AddWebNotificationTray(); 99 void AddWebNotificationTray();
91 #if defined(OS_CHROMEOS) 100 #if defined(OS_CHROMEOS)
92 void AddLogoutButtonTray(); 101 void AddLogoutButtonTray();
93 void AddPaletteTray(); 102 void AddPaletteTray();
94 void AddVirtualKeyboardTray(); 103 void AddVirtualKeyboardTray();
95 void AddImeMenuTray(); 104 void AddImeMenuTray();
96 #endif 105 #endif
97 void AddOverviewButtonTray(); 106 void AddOverviewButtonTray();
(...skipping 12 matching lines...) Expand all
110 LoginStatus login_status_; 119 LoginStatus login_status_;
111 120
112 WmShelf* wm_shelf_; 121 WmShelf* wm_shelf_;
113 122
114 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); 123 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget);
115 }; 124 };
116 125
117 } // namespace ash 126 } // namespace ash
118 127
119 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_ 128 #endif // ASH_COMMON_SYSTEM_STATUS_AREA_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698