Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / ash / system / tray / tray_image_item.h
blob6fad95f3a8294b6b236ed06433d2f67294c9b9f8
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 virtual ~TrayImageItem();
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 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE;
32 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
33 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
34 virtual void DestroyTrayView() OVERRIDE;
35 virtual void DestroyDefaultView() OVERRIDE;
36 virtual void DestroyDetailedView() OVERRIDE;
37 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE;
38 virtual void UpdateAfterShelfAlignmentChange(
39 ShelfAlignment alignment) OVERRIDE;
41 private:
42 // Set the alignment of the image depending on the shelf alignment.
43 void SetItemAlignment(ShelfAlignment alignment);
45 int resource_id_;
46 TrayItemView* tray_view_;
48 DISALLOW_COPY_AND_ASSIGN(TrayImageItem);
51 } // namespace ash
53 #endif // ASH_SYSTEM_TRAY_TRAY_IMAGE_ITEM_H_