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

Side by Side Diff: ash/system/tray/tray_image_item.h

Issue 2063813002: mash: Move SystemTrayImage and TrayImageItem to //ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@wmnotifier
Patch Set: rebase Created 4 years, 6 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
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698