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

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: Improved the TrayPopupItemStyle concept. 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..921e090e9f8a2816bec9f6c070dbb98db3cd97ec 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>
+
#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"
@@ -20,7 +24,7 @@ class SystemTrayItem;
// A view with a chevron ('>') on the right edge. Clicking on the view brings up
tdanderson 2016/09/08 16:11:02 Maybe update this documentation while you're here.
bruthig 2016/09/12 13:45:34 Updated, WDYT?
tdanderson 2016/09/12 18:51:46 lg
// the detailed view of the tray-item that owns it.
-class TrayItemMore : public ActionableView {
+class TrayItemMore : public ActionableView, public TrayPopupItemStyleObserver {
public:
TrayItemMore(SystemTrayItem* owner, bool show_more);
~TrayItemMore() override;
@@ -31,19 +35,27 @@ 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. OnTrayPopupItemStyleChanged()
+ // 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 OnTrayPopupItemStyleChanged() override;
+
+ TrayPopupItemStyle* style() const { return style_.get(); }
private:
+ // Updates the children Views owned by this.
+ void UpdateChildren();
+
// Overridden from ActionableView.
bool PerformAction(const ui::Event& event) override;
// 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,9 @@ class TrayItemMore : public ActionableView {
views::ImageView* more_;
base::string16 accessible_name_;
+ // Current visual style of this item.
tdanderson 2016/09/08 16:11:02 consider specifying here (or in the class-level do
bruthig 2016/09/12 13:45:34 Done.
+ std::unique_ptr<TrayPopupItemStyle> style_;
+
DISALLOW_COPY_AND_ASSIGN(TrayItemMore);
};

Powered by Google App Engine
This is Rietveld 408576698