Add toplevel trace event to MessagePumpLibevent::OnLibeventNotification
[chromium-blink-merge.git] / ash / system / tray / tray_image_item.h
blob64a28c1dcac7e8242fd2123155d521973234c54a
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.
5 #ifndef ASH_SYSTEM_TRAY_TRAY_IMAGE_ITEM_H_
6 #define ASH_SYSTEM_TRAY_TRAY_IMAGE_ITEM_H_
8 #include "ash/system/tray/system_tray_item.h"
10 namespace views {
11 class ImageView;
14 namespace ash {
15 class TrayItemView;
17 class TrayImageItem : public SystemTrayItem {
18 public:
19 TrayImageItem(SystemTray* system_tray, int resource_id);
20 ~TrayImageItem() override;
22 views::View* tray_view();
24 // Changes the icon of the tray-view to the specified resource.
25 void SetImageFromResourceId(int resource_id);
27 protected:
28 virtual bool GetInitialVisibility() = 0;
30 // Overridden from SystemTrayItem.
31 views::View* CreateTrayView(user::LoginStatus status) override;
32 views::View* CreateDefaultView(user::LoginStatus status) override;
33 views::View* CreateDetailedView(user::LoginStatus status) override;
34 void DestroyTrayView() override;
35 void DestroyDefaultView() override;
36 void DestroyDetailedView() override;
37 void UpdateAfterLoginStatusChange(user::LoginStatus status) override;
38 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override;
40 private:
41 // Set the alignment of the image depending on the shelf alignment.
42 void SetItemAlignment(ShelfAlignment alignment);
44 int resource_id_;
45 TrayItemView* tray_view_;
47 DISALLOW_COPY_AND_ASSIGN(TrayImageItem);
50 } // namespace ash
52 #endif // ASH_SYSTEM_TRAY_TRAY_IMAGE_ITEM_H_