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

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: Re-ordered static function in Label. 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/macros.h"
9 #include "base/observer_list.h"
10 #include "third_party/skia/include/core/SkColor.h"
11
12 namespace ui {
13 class NativeTheme;
14 } // namespace ui
15
16 namespace views {
17 class Label;
18 } // namespace views
19
20 namespace ash {
21 class TrayPopupItemStyleObserver;
22
23 // Central style provider for the system tray menu. Makes it easier to ensure
24 // all visuals are consistent and easily updated in one spot instead of being
25 // defined in multiple places throughout the code.
26 class TrayPopupItemStyle {
27 public:
28 // The different visual styles that a row can have.
29 enum class ColorStyle {
30 // Active and clickable.
31 ACTIVE,
32 // Inactive but clickable.
33 INACTIVE,
34 // Disabled and not clickable.
35 DISABLED,
36 };
37
38 // The different font styles that row text can have.
39 enum class FontStyle {
40 // Header rows for default view and detailed view.
41 TITLE,
42 // Main text used by default view rows.
43 DEFAULT_VIEW_LABEL,
44 // Main text used by detailed view rows.
45 DETAILED_VIEW_LABEL,
46 // System information text (e.g. date/time, battery status, etc).
47 SYSTEM_INFO,
48 // Sub text within a row (e.g. user name in user row).
49 CAPTION,
50 // Child buttons within rows that have a visible border (e.g. Cast's
51 // "Stop", etc).
52 BUTTON,
53 };
54
55 TrayPopupItemStyle(const ui::NativeTheme* theme, FontStyle font_style);
56 ~TrayPopupItemStyle();
57
58 void AddObserver(TrayPopupItemStyleObserver* observer);
59 void RemoveObserver(TrayPopupItemStyleObserver* observer);
60
61 const ui::NativeTheme* theme() const { return theme_; }
62
63 // Sets the |theme_| and notifies observers.
64 void SetTheme(const ui::NativeTheme* theme);
65
66 ColorStyle color_style() const { return color_style_; }
67
68 // Sets the |color_style_| and notifies observers if |color_style_| changed.
69 void SetColorStyle(ColorStyle color_style);
70
71 FontStyle font_style() const { return font_style_; }
72
73 // Sets the |font_style_| notifies observers if |font_style_| changed.
74 void SetFontStyle(FontStyle font_style);
75
76 SkColor GetForegroundColor() const;
77
78 // Configures a Label as per the style (e.g. color, font).
79 void SetupLabel(views::Label* label) const;
80
81 private:
82 void NotifyObserversStyleUpdated();
83
84 // The theme that the styles are dervied from.
85 const ui::NativeTheme* theme_;
86
87 FontStyle font_style_;
88
89 ColorStyle color_style_;
90
91 base::ObserverList<TrayPopupItemStyleObserver> observers_;
92
93 DISALLOW_COPY_AND_ASSIGN(TrayPopupItemStyle);
94 };
95
96 } // namespace ash
97
98 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_POPUP_ITEM_STYLE_H_
OLDNEW
« no previous file with comments | « ash/common/system/tray/tray_item_more.cc ('k') | ash/common/system/tray/tray_popup_item_style.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698