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

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

Issue 2699443004: Modify TrayItemMore to use enabled status (Closed)
Patch Set: Rebased Created 3 years, 10 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 6bf2909cb41d57b4ac50419d439b374df7ad0291..fbbd721942fefc5e5b290855ecdf1e55e9047fe9 100644
--- a/ash/common/system/tray/tray_item_more.h
+++ b/ash/common/system/tray/tray_item_more.h
@@ -20,12 +20,14 @@ class View;
namespace ash {
class SystemTrayItem;
class TrayPopupItemStyle;
+class TriView;
// 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.
+// the detailed view of the tray-item that owns it. If the view is disabled, it
+// will not show the more arrow.
class TrayItemMore : public ActionableView {
public:
- TrayItemMore(SystemTrayItem* owner, bool show_more);
+ explicit TrayItemMore(SystemTrayItem* owner);
~TrayItemMore() override;
void SetLabel(const base::string16& label);
@@ -33,20 +35,21 @@ class TrayItemMore : public ActionableView {
void SetAccessibleName(const base::string16& name);
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;
+ // Returns a style that will be applied to the elements in the UpdateStyle()
+ // method if |this| is enabled; otherwise, we force |this| to use
+ // ColorStyle::DISABLED.
+ std::unique_ptr<TrayPopupItemStyle> CreateStyle() const;
+
+ // Called by CreateStyle() to give descendants a chance to customize the
+ // style; e.g. to change the style's ColorStyle based on whether Bluetooth is
+ // enabled/disabled.
+ virtual std::unique_ptr<TrayPopupItemStyle> HandleCreateStyle() 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
+ // 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:
@@ -55,10 +58,10 @@ class TrayItemMore : public ActionableView {
// Overridden from views::View.
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
+ void OnEnabledChanged() override;
void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
- // True if |more_| should be shown.
- bool show_more_;
+ TriView* tri_view_;
views::ImageView* icon_;
views::Label* label_;
views::ImageView* more_;
« 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