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

Side by Side 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: Deferred generic TrayItemPopupStyle application to TrayItemMore. 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
tdanderson 2016/09/15 19:49:33 nit: please update actual CL title to "Materialize
bruthig 2016/09/15 19:55:08 Done.
4 4
5 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_MORE_H_ 5 #ifndef ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_MORE_H_
6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_MORE_H_ 6 #define ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_MORE_H_
7 7
8 #include "ash/common/system/tray/actionable_view.h" 8 #include "ash/common/system/tray/actionable_view.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "ui/views/view.h" 10 #include "ui/views/view.h"
11 11
12 namespace views { 12 namespace views {
13 class ImageView; 13 class ImageView;
(...skipping 17 matching lines...) Expand all
31 void SetImage(const gfx::ImageSkia& image_skia); 31 void SetImage(const gfx::ImageSkia& image_skia);
32 void SetAccessibleName(const base::string16& name); 32 void SetAccessibleName(const base::string16& name);
33 33
34 protected: 34 protected:
35 // Replaces the default icon (on the left of the label), and allows a custom 35 // Replaces the default icon (on the left of the label), and allows a custom
36 // view to be placed there. Once the default icon is replaced, |SetImage| 36 // view to be placed there. Once the default icon is replaced, |SetImage|
37 // should never be called. 37 // should never be called.
38 void ReplaceIcon(views::View* view); 38 void ReplaceIcon(views::View* view);
39 39
40 private: 40 private:
41 // TODO(bruthig): Re-design to inform subclasses when the style changes while
42 // avoiding virtual function calls from the constructor.
43 void UpdateStyle();
44
41 // Overridden from ActionableView. 45 // Overridden from ActionableView.
42 bool PerformAction(const ui::Event& event) override; 46 bool PerformAction(const ui::Event& event) override;
43 47
44 // Overridden from views::View. 48 // Overridden from views::View.
45 void Layout() override; 49 void Layout() override;
46 void GetAccessibleState(ui::AXViewState* state) override; 50 void GetAccessibleState(ui::AXViewState* state) override;
51 void ViewHierarchyChanged(
52 const ViewHierarchyChangedDetails& details) override;
53 void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
47 54
48 SystemTrayItem* owner_; 55 SystemTrayItem* owner_;
49 // True if |more_| should be shown. 56 // True if |more_| should be shown.
50 bool show_more_; 57 bool show_more_;
51 views::ImageView* icon_; 58 views::ImageView* icon_;
52 views::Label* label_; 59 views::Label* label_;
53 views::ImageView* more_; 60 views::ImageView* more_;
54 base::string16 accessible_name_; 61 base::string16 accessible_name_;
55 62
56 DISALLOW_COPY_AND_ASSIGN(TrayItemMore); 63 DISALLOW_COPY_AND_ASSIGN(TrayItemMore);
57 }; 64 };
58 65
59 } // namespace ash 66 } // namespace ash
60 67
61 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_MORE_H_ 68 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_MORE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698