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

Side by Side Diff: ash/common/system/tray/tray_popup_item_style.h

Issue 2244003002: Materialized font style for TrayItemMore type system tray rows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Deferred generic TrayItemPopupStyle application to TrayItemMore. Created 4 years, 3 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_ITEM_STYLE_H_
6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_ITEM_STYLE_H_
7
8 #include "base/observer_list.h"
9 #include "third_party/skia/include/core/SkColor.h"
10
11 namespace ui {
12 class NativeTheme;
13 } // namespace ui
14
15 namespace views {
16 class Label;
17 } // namespace views
18
19 namespace ash {
20 class TrayPopupItemStyleObserver;
21
22 // Central style provider for the system tray menu. Makes it easier to ensure
23 // all visuals are consistent and easily updated in one spot instead of being
24 // defined in multiple places throughout the code.
25 class TrayPopupItemStyle {
26 public:
27 // The different visual styles that a row can have.
28 enum class ColorStyle {
29 // Active and clickable.
30 ACTIVE,
31 // Inactive but clickable.
32 INACTIVE,
33 // Disabled and not clickable.
34 DISABLED,
35 };
36
37 // The different font styles that row text can have.
38 enum class FontStyle {
39 // Header rows for default view and detailed view.
40 TITLE,
41 // Main text used by default view rows.
42 DEFAULT_VIEW_LABEL,
43 // Main text used by detailed view rows.
44 DETAILED_VIEW_LABEL,
45 // System information text (e.g. date/time, battery status, etc).
46 SYSTEM_INFO,
tdanderson 2016/09/15 19:49:33 I'm not super excited about the SYSTEM_INFO name s
bruthig 2016/09/15 19:55:08 Acknowledged.
47 // Sub text within a row (e.g. user name in user row).
48 CAPTION,
49 // Child buttons within rows that have a visible border (e.g. "Sign out",
50 // "Lock", Cast's "Stop", etc).
tdanderson 2016/09/15 19:49:34 Sign out / lock are sort of in flux, just use Cast
bruthig 2016/09/15 21:17:34 Done.
51 BUTTON,
52 };
53
54 TrayPopupItemStyle(const ui::NativeTheme* theme, FontStyle font_style);
55 ~TrayPopupItemStyle();
56
57 void AddObserver(TrayPopupItemStyleObserver* observer);
58 void RemoveObserver(TrayPopupItemStyleObserver* observer);
59
60 const ui::NativeTheme* theme() const { return theme_; }
61
62 // Sets the |theme_| and notifies observers.
63 void SetTheme(const ui::NativeTheme* theme);
64
65 ColorStyle color_style() const { return color_style_; }
tdanderson 2016/09/15 19:49:33 The member this returns is non-const, so the acces
bruthig 2016/09/15 21:17:34 Discussed offline. Summary: ColorStyle and FontSt
66
67 // Sets the |color_style_| and notifies observers if |color_style_| changed.
68 void SetColorStyle(ColorStyle color_style);
69
70 FontStyle font_style() const { return font_style_; }
71
72 // Sets the |font_style_| notifies observers if |font_style_| changed.
73 void SetFontStyle(FontStyle font_style);
74
75 SkColor GetForegroundColor() const;
76
77 // Configures a Label as per the style (e.g. color, font).
78 void SetupLabel(views::Label* label) const;
79
80 private:
81 void NotifyObserversStyleUpdated();
82
83 // The theme that the styles are dervied from.
84 const ui::NativeTheme* theme_;
85
86 FontStyle font_style_;
87
88 ColorStyle color_style_;
89
90 base::ObserverList<TrayPopupItemStyleObserver> observers_;
91 };
tdanderson 2016/09/15 19:49:34 DISALLOW_COPY_AND_ASSIGN?
bruthig 2016/09/15 21:17:34 Done.
92
93 } // namespace ash
94
95 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_ITEM_STYLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698