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

Unified Diff: ash/common/system/tray/tray_item_more.h

Issue 2365523002: Materialized the font/icon color for some default rows in the system menu. (Closed)
Patch Set: Addressed tdanderson@ comments from previous patch set. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/common/system/ime/tray_ime_chromeos.cc ('k') | ash/common/system/tray/tray_item_more.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/tray/tray_item_more.h
diff --git a/ash/common/system/tray/tray_item_more.h b/ash/common/system/tray/tray_item_more.h
index acd9b30a6b729354140f07d94da14388b5ba2347..0c9bac5cedc07be1874dc87af6637465c9bcb441 100644
--- a/ash/common/system/tray/tray_item_more.h
+++ b/ash/common/system/tray/tray_item_more.h
@@ -5,6 +5,8 @@
#ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_MORE_H_
#define ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_MORE_H_
+#include <memory>
+
#include "ash/common/system/tray/actionable_view.h"
#include "base/macros.h"
#include "ui/views/view.h"
@@ -17,8 +19,9 @@ class View;
namespace ash {
class SystemTrayItem;
+class TrayPopupItemStyle;
-// A view with a chevron ('>') on the right edge. Clicking on the view brings up
+// A view with a more arrow on the right edge. Clicking on the view brings up
// the detailed view of the tray-item that owns it.
class TrayItemMore : public ActionableView {
public:
@@ -31,11 +34,24 @@ class TrayItemMore : public ActionableView {
void SetImage(const gfx::ImageSkia& image_skia);
void SetAccessibleName(const base::string16& name);
- private:
- // TODO(bruthig): Re-design to inform subclasses when the style changes while
- // avoiding virtual function calls from the constructor.
- void UpdateStyle();
+ protected:
+ // Returns a style that will be applied to elements in the UpdateStyle()
+ // method. e.g. changing the label's font and color. Descendants can override
+ // to apply specialized configurations of the style. e.g. changing the style's
+ // ColorStyle based on whether Bluetooth is enabled/disabled.
+ virtual std::unique_ptr<TrayPopupItemStyle> CreateStyle() const;
+ // Applies the style created from CreateStyle(). Should be called whenever any
+ // input state changes that changes the style configuration created by
+ // CreateStyle(). e.g. if Bluetooth is changed between enabled/disabled then
+ // a differently configured style will be returned from CreateStyle() and thus
+ // it will need to be applied.
+ //
+ // By default this will be called when OnNativeThemeChanged() is called which
+ // will ensure the most up to date theme is actually applied.
+ virtual void UpdateStyle();
+
+ private:
// Overridden from ActionableView.
bool PerformAction(const ui::Event& event) override;
« no previous file with comments | « ash/common/system/ime/tray_ime_chromeos.cc ('k') | ash/common/system/tray/tray_item_more.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698