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_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ash/ash_export.h" | 9 #include "ash/ash_export.h" |
| 10 #include "ash/system/user/login_status.h" |
10 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
11 #include "ui/views/view.h" | 12 #include "ui/views/view.h" |
12 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget.h" |
13 | 14 |
14 #include <vector> | 15 #include <vector> |
15 | 16 |
16 namespace ash { | 17 namespace ash { |
17 | 18 |
18 class SystemTrayItem; | 19 class SystemTrayItem; |
19 | 20 |
20 class ASH_EXPORT SystemTray : public views::View, | 21 class ASH_EXPORT SystemTray : public views::View, |
21 public views::Widget::Observer { | 22 public views::Widget::Observer { |
22 public: | 23 public: |
23 SystemTray(); | 24 SystemTray(); |
24 virtual ~SystemTray(); | 25 virtual ~SystemTray(); |
25 | 26 |
26 // Adds a new item in the tray. | 27 // Adds a new item in the tray. |
27 void AddTrayItem(SystemTrayItem* item); | 28 void AddTrayItem(SystemTrayItem* item); |
28 | 29 |
29 // Removes an existing tray item. | 30 // Removes an existing tray item. |
30 void RemoveTrayItem(SystemTrayItem* item); | 31 void RemoveTrayItem(SystemTrayItem* item); |
31 | 32 |
32 // Shows details of a particular item. | 33 // Shows details of a particular item. |
33 void ShowDetailedView(SystemTrayItem* item); | 34 void ShowDetailedView(SystemTrayItem* item); |
34 | 35 |
| 36 // Updates the items when the login status of the system changes. |
| 37 void UpdateAfterLoginStatusChange(user::LoginStatus login_status); |
| 38 |
35 const std::vector<SystemTrayItem*>& items() const { return items_; } | 39 const std::vector<SystemTrayItem*>& items() const { return items_; } |
36 | 40 |
37 private: | 41 private: |
38 void ShowItems(std::vector<SystemTrayItem*>& items, bool details); | 42 void ShowItems(std::vector<SystemTrayItem*>& items, bool details); |
39 | 43 |
40 // Overridden from views::View. | 44 // Overridden from views::View. |
41 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | 45 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; |
42 | 46 |
43 // Overridden from views::Widget::Observer. | 47 // Overridden from views::Widget::Observer. |
44 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; | 48 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
45 | 49 |
46 std::vector<SystemTrayItem*> items_; | 50 std::vector<SystemTrayItem*> items_; |
47 | 51 |
48 // The popup widget. | 52 // The popup widget. |
49 views::Widget* popup_; | 53 views::Widget* popup_; |
50 | 54 |
51 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 55 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
52 }; | 56 }; |
53 | 57 |
54 } // namespace ash | 58 } // namespace ash |
55 | 59 |
56 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 60 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
OLD | NEW |