| OLD | NEW |
| 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. |
| 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 <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "ash/common/system/tray/actionable_view.h" | 10 #include "ash/common/system/tray/actionable_view.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 class SystemTrayItem; | 21 class SystemTrayItem; |
| 22 class TrayPopupItemStyle; | 22 class TrayPopupItemStyle; |
| 23 | 23 |
| 24 // A view with a more arrow on the right edge. Clicking on the view brings up | 24 // A view with a more arrow on the right edge. Clicking on the view brings up |
| 25 // the detailed view of the tray-item that owns it. | 25 // the detailed view of the tray-item that owns it. |
| 26 class TrayItemMore : public ActionableView { | 26 class TrayItemMore : public ActionableView { |
| 27 public: | 27 public: |
| 28 TrayItemMore(SystemTrayItem* owner, bool show_more); | 28 TrayItemMore(SystemTrayItem* owner, bool show_more); |
| 29 ~TrayItemMore() override; | 29 ~TrayItemMore() override; |
| 30 | 30 |
| 31 SystemTrayItem* owner() const { return owner_; } | |
| 32 | |
| 33 void SetLabel(const base::string16& label); | 31 void SetLabel(const base::string16& label); |
| 34 void SetImage(const gfx::ImageSkia& image_skia); | 32 void SetImage(const gfx::ImageSkia& image_skia); |
| 35 void SetAccessibleName(const base::string16& name); | 33 void SetAccessibleName(const base::string16& name); |
| 36 | 34 |
| 37 protected: | 35 protected: |
| 38 // Returns a style that will be applied to elements in the UpdateStyle() | 36 // Returns a style that will be applied to elements in the UpdateStyle() |
| 39 // method. e.g. changing the label's font and color. Descendants can override | 37 // method. e.g. changing the label's font and color. Descendants can override |
| 40 // to apply specialized configurations of the style. e.g. changing the style's | 38 // to apply specialized configurations of the style. e.g. changing the style's |
| 41 // ColorStyle based on whether Bluetooth is enabled/disabled. | 39 // ColorStyle based on whether Bluetooth is enabled/disabled. |
| 42 virtual std::unique_ptr<TrayPopupItemStyle> CreateStyle() const; | 40 virtual std::unique_ptr<TrayPopupItemStyle> CreateStyle() const; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 53 | 51 |
| 54 private: | 52 private: |
| 55 // Overridden from ActionableView. | 53 // Overridden from ActionableView. |
| 56 bool PerformAction(const ui::Event& event) override; | 54 bool PerformAction(const ui::Event& event) override; |
| 57 | 55 |
| 58 // Overridden from views::View. | 56 // Overridden from views::View. |
| 59 void Layout() override; | 57 void Layout() override; |
| 60 void GetAccessibleState(ui::AXViewState* state) override; | 58 void GetAccessibleState(ui::AXViewState* state) override; |
| 61 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; | 59 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
| 62 | 60 |
| 63 SystemTrayItem* owner_; | |
| 64 // True if |more_| should be shown. | 61 // True if |more_| should be shown. |
| 65 bool show_more_; | 62 bool show_more_; |
| 66 views::ImageView* icon_; | 63 views::ImageView* icon_; |
| 67 views::Label* label_; | 64 views::Label* label_; |
| 68 views::ImageView* more_; | 65 views::ImageView* more_; |
| 69 base::string16 accessible_name_; | 66 base::string16 accessible_name_; |
| 70 | 67 |
| 71 DISALLOW_COPY_AND_ASSIGN(TrayItemMore); | 68 DISALLOW_COPY_AND_ASSIGN(TrayItemMore); |
| 72 }; | 69 }; |
| 73 | 70 |
| 74 } // namespace ash | 71 } // namespace ash |
| 75 | 72 |
| 76 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_MORE_H_ | 73 #endif // ASH_COMMON_SYSTEM_TRAY_TRAY_ITEM_MORE_H_ |
| OLD | NEW |