| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_SYSTEM_TRAY_TRAY_IMAGE_ITEM_H_ | |
| 6 #define ASH_SYSTEM_TRAY_TRAY_IMAGE_ITEM_H_ | |
| 7 | |
| 8 #include "ash/ash_export.h" | |
| 9 #include "ash/system/tray/system_tray_item.h" | |
| 10 #include "base/macros.h" | |
| 11 | |
| 12 namespace views { | |
| 13 class ImageView; | |
| 14 } | |
| 15 | |
| 16 namespace ash { | |
| 17 class TrayItemView; | |
| 18 | |
| 19 class ASH_EXPORT TrayImageItem : public SystemTrayItem { | |
| 20 public: | |
| 21 TrayImageItem(SystemTray* system_tray, int resource_id); | |
| 22 ~TrayImageItem() override; | |
| 23 | |
| 24 views::View* tray_view(); | |
| 25 | |
| 26 // Changes the icon of the tray-view to the specified resource. | |
| 27 void SetImageFromResourceId(int resource_id); | |
| 28 | |
| 29 protected: | |
| 30 virtual bool GetInitialVisibility() = 0; | |
| 31 | |
| 32 // Overridden from SystemTrayItem. | |
| 33 views::View* CreateTrayView(LoginStatus status) override; | |
| 34 views::View* CreateDefaultView(LoginStatus status) override; | |
| 35 views::View* CreateDetailedView(LoginStatus status) override; | |
| 36 void DestroyTrayView() override; | |
| 37 void DestroyDefaultView() override; | |
| 38 void DestroyDetailedView() override; | |
| 39 void UpdateAfterLoginStatusChange(LoginStatus status) override; | |
| 40 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override; | |
| 41 | |
| 42 private: | |
| 43 // Set the alignment of the image depending on the shelf alignment. | |
| 44 void SetItemAlignment(ShelfAlignment alignment); | |
| 45 | |
| 46 int resource_id_; | |
| 47 TrayItemView* tray_view_; | |
| 48 | |
| 49 DISALLOW_COPY_AND_ASSIGN(TrayImageItem); | |
| 50 }; | |
| 51 | |
| 52 } // namespace ash | |
| 53 | |
| 54 #endif // ASH_SYSTEM_TRAY_TRAY_IMAGE_ITEM_H_ | |
| OLD | NEW |