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

Unified Diff: ash/common/system/tray/tray_item_more.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: Updated TrayPopupItemStyle to use the default FontList. 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
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 918d3c38fe5b64ecdf80d73af2de2d26589d837b..fad16282aba34203a686489e6eea077f9e676a5e 100644
--- a/ash/common/system/tray/tray_item_more.h
+++ b/ash/common/system/tray/tray_item_more.h
@@ -5,7 +5,11 @@
#ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_MORE_H_
#define ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_MORE_H_
+#include <memory>
tdanderson 2016/09/12 18:51:47 is this needed?
bruthig 2016/09/15 18:56:29 Yup, for unique_ptr<>.
+
#include "ash/common/system/tray/actionable_view.h"
+#include "ash/common/system/tray/tray_popup_item_style.h"
+#include "ash/common/system/tray/tray_popup_item_style_observer.h"
#include "base/macros.h"
#include "ui/views/view.h"
@@ -18,9 +22,9 @@ class View;
namespace ash {
class SystemTrayItem;
-// A view with a chevron ('>') on the right edge. Clicking on the view brings up
-// the detailed view of the tray-item that owns it.
-class TrayItemMore : public ActionableView {
+// A view with a 'more' arrow icon 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 TrayPopupItemStyleObserver {
public:
TrayItemMore(SystemTrayItem* owner, bool show_more);
~TrayItemMore() override;
@@ -31,11 +35,18 @@ class TrayItemMore : public ActionableView {
void SetImage(const gfx::ImageSkia& image_skia);
void SetAccessibleName(const base::string16& name);
+ // Set the current visual style of this item. OnTrayPopupItemStyleUpdated()
+ // will be called.
+ void SetStyle(std::unique_ptr<TrayPopupItemStyle> style);
+
protected:
- // Replaces the default icon (on the left of the label), and allows a custom
- // view to be placed there. Once the default icon is replaced, |SetImage|
- // should never be called.
- void ReplaceIcon(views::View* view);
+ // TrayPopupItemStyleObserver:
+ void OnTrayPopupItemStyleUpdated() override;
+
+ TrayPopupItemStyle* style() const { return style_.get(); }
+
+ // Update the content of this (e.g. Label text, font, color, etc).
+ virtual void UpdateContent();
private:
// Overridden from ActionableView.
tdanderson 2016/09/12 18:51:47 nit: just "// ActionableView:" while you're here.
bruthig 2016/09/15 18:56:29 Done.
@@ -44,6 +55,7 @@ class TrayItemMore : public ActionableView {
// Overridden from views::View.
void Layout() override;
void GetAccessibleState(ui::AXViewState* state) override;
+ void OnThemeChanged() override;
SystemTrayItem* owner_;
// True if |more_| should be shown.
@@ -53,6 +65,10 @@ class TrayItemMore : public ActionableView {
views::ImageView* more_;
base::string16 accessible_name_;
+ // Current visual style of this item. This only applies when system menu is
+ // using the material design look and feel.
+ std::unique_ptr<TrayPopupItemStyle> style_;
+
DISALLOW_COPY_AND_ASSIGN(TrayItemMore);
};

Powered by Google App Engine
This is Rietveld 408576698