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

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: address comments 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 "base/macros.h" 12 #include "base/macros.h"
13 #include "ui/views/widget/widget.h" 13 #include "ui/views/widget/widget.h"
14 14
15 namespace ash { 15 namespace ash {
16 class OverviewButtonTray; 16 class OverviewButtonTray;
17 class ShellDelegate; 17 class ShellDelegate;
18 class StatusAreaWidgetDelegate; 18 class StatusAreaWidgetDelegate;
19 class SystemTray; 19 class SystemTray;
20 class TrayBackgroundView;
20 class WebNotificationTray; 21 class WebNotificationTray;
21 class WmShelf; 22 class WmShelf;
22 class WmWindow; 23 class WmWindow;
23 #if defined(OS_CHROMEOS) 24 #if defined(OS_CHROMEOS)
24 class ImeMenuTray; 25 class ImeMenuTray;
25 class LogoutButtonTray; 26 class LogoutButtonTray;
26 class PaletteTray; 27 class PaletteTray;
27 class VirtualKeyboardTray; 28 class VirtualKeyboardTray;
28 #endif 29 #endif
29 30
(...skipping 11 matching lines...) Expand all
41 void Shutdown(); 42 void Shutdown();
42 43
43 // Update the alignment of the widget and tray views. 44 // Update the alignment of the widget and tray views.
44 void SetShelfAlignment(ShelfAlignment alignment); 45 void SetShelfAlignment(ShelfAlignment alignment);
45 46
46 // Called by the client when the login status changes. Caches login_status 47 // Called by the client when the login status changes. Caches login_status
47 // and calls UpdateAfterLoginStatusChange for the system tray and the web 48 // and calls UpdateAfterLoginStatusChange for the system tray and the web
48 // notification tray. 49 // notification tray.
49 void UpdateAfterLoginStatusChange(LoginStatus login_status); 50 void UpdateAfterLoginStatusChange(LoginStatus login_status);
50 51
52 // Based on visibility of |tray| and tray item on its right, sets |tray|'s
varkha 2016/08/11 20:01:03 nit: s/and tray item/and a tray item
yiyix 2016/08/18 00:43:00 Done.
53 // separator visibility either to true or false. Note that no leading
54 // separator is required before the logout_button_tray because that
55 // button's red background is distinctive on its own.
56 void OnTrayVisibilityChanged(TrayBackgroundView* tray);
57
51 StatusAreaWidgetDelegate* status_area_widget_delegate() { 58 StatusAreaWidgetDelegate* status_area_widget_delegate() {
52 return status_area_widget_delegate_; 59 return status_area_widget_delegate_;
53 } 60 }
54 SystemTray* system_tray() { return system_tray_; } 61 SystemTray* system_tray() { return system_tray_; }
55 WebNotificationTray* web_notification_tray() { 62 WebNotificationTray* web_notification_tray() {
56 return web_notification_tray_; 63 return web_notification_tray_;
57 } 64 }
58 OverviewButtonTray* overview_button_tray() { return overview_button_tray_; } 65 OverviewButtonTray* overview_button_tray() { return overview_button_tray_; }
59 66
60 #if defined(OS_CHROMEOS) 67 #if defined(OS_CHROMEOS)
(...skipping 23 matching lines...) Expand all
84 void UpdateShelfItemBackground(int alpha) override; 91 void UpdateShelfItemBackground(int alpha) override;
85 92
86 private: 93 private:
87 void AddSystemTray(); 94 void AddSystemTray();
88 void AddWebNotificationTray(); 95 void AddWebNotificationTray();
89 #if defined(OS_CHROMEOS) 96 #if defined(OS_CHROMEOS)
90 void AddLogoutButtonTray(); 97 void AddLogoutButtonTray();
91 void AddPaletteTray(); 98 void AddPaletteTray();
92 void AddVirtualKeyboardTray(); 99 void AddVirtualKeyboardTray();
93 void AddImeMenuTray(); 100 void AddImeMenuTray();
101
102 // Check if |tray| is next visible tray to the |logout_button_tray_|. If
James Cook 2016/08/11 20:36:55 nit: By "next visible tray" do you mean next in th
yiyix 2016/08/18 00:43:00 I mean it is next in the view child list, so it di
103 // |logout_button_tray_| is not visible, then it returns false.
104 bool IsNextVisibleTrayToLogout(TrayBackgroundView* tray);
94 #endif 105 #endif
95 void AddOverviewButtonTray(); 106 void AddOverviewButtonTray();
96 107
97 // Weak pointers to View classes that are parented to StatusAreaWidget: 108 // Weak pointers to View classes that are parented to StatusAreaWidget:
98 StatusAreaWidgetDelegate* status_area_widget_delegate_; 109 StatusAreaWidgetDelegate* status_area_widget_delegate_;
99 OverviewButtonTray* overview_button_tray_; 110 OverviewButtonTray* overview_button_tray_;
100 SystemTray* system_tray_; 111 SystemTray* system_tray_;
101 WebNotificationTray* web_notification_tray_; 112 WebNotificationTray* web_notification_tray_;
102 #if defined(OS_CHROMEOS) 113 #if defined(OS_CHROMEOS)
103 LogoutButtonTray* logout_button_tray_; 114 LogoutButtonTray* logout_button_tray_;
104 PaletteTray* palette_tray_; 115 PaletteTray* palette_tray_;
105 VirtualKeyboardTray* virtual_keyboard_tray_; 116 VirtualKeyboardTray* virtual_keyboard_tray_;
106 ImeMenuTray* ime_menu_tray_; 117 ImeMenuTray* ime_menu_tray_;
107 #endif 118 #endif
108 LoginStatus login_status_; 119 LoginStatus login_status_;
109 120
110 WmShelf* wm_shelf_; 121 WmShelf* wm_shelf_;
111 122
112 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget); 123 DISALLOW_COPY_AND_ASSIGN(StatusAreaWidget);
113 }; 124 };
114 125
115 } // namespace ash 126 } // namespace ash
116 127
117 #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