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_BUBBLE_H_ | 5 #ifndef ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ |
6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ | 6 #define ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ |
7 | 7 |
8 #include "ash/system/tray/tray_bubble_view.h" | |
9 #include "ash/system/user/login_status.h" | 8 #include "ash/system/user/login_status.h" |
10 #include "base/base_export.h" | 9 #include "base/base_export.h" |
11 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
12 #include "base/timer.h" | 11 #include "base/timer.h" |
| 12 #include "ui/views/bubble/tray_bubble_view.h" |
13 | 13 |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 namespace ash { | 16 namespace ash { |
17 | 17 |
18 class SystemTray; | 18 class SystemTray; |
19 class SystemTrayItem; | 19 class SystemTrayItem; |
20 | 20 |
21 namespace internal { | 21 namespace internal { |
22 | 22 |
(...skipping 11 matching lines...) Expand all Loading... |
34 virtual ~SystemTrayBubble(); | 34 virtual ~SystemTrayBubble(); |
35 | 35 |
36 // Change the items displayed in the bubble. | 36 // Change the items displayed in the bubble. |
37 void UpdateView(const std::vector<ash::SystemTrayItem*>& items, | 37 void UpdateView(const std::vector<ash::SystemTrayItem*>& items, |
38 BubbleType bubble_type); | 38 BubbleType bubble_type); |
39 | 39 |
40 // Creates |bubble_view_| and a child views for each member of |items_|. | 40 // Creates |bubble_view_| and a child views for each member of |items_|. |
41 // Also creates |bubble_wrapper_|. |init_params| may be modified. | 41 // Also creates |bubble_wrapper_|. |init_params| may be modified. |
42 void InitView(views::View* anchor, | 42 void InitView(views::View* anchor, |
43 user::LoginStatus login_status, | 43 user::LoginStatus login_status, |
44 message_center::TrayBubbleView::InitParams* init_params); | 44 views::TrayBubbleView::InitParams* init_params); |
45 | 45 |
46 BubbleType bubble_type() const { return bubble_type_; } | 46 BubbleType bubble_type() const { return bubble_type_; } |
47 message_center::TrayBubbleView* bubble_view() const { return bubble_view_; } | 47 views::TrayBubbleView* bubble_view() const { return bubble_view_; } |
48 | 48 |
49 void DestroyItemViews(); | 49 void DestroyItemViews(); |
50 void BubbleViewDestroyed(); | 50 void BubbleViewDestroyed(); |
51 void StartAutoCloseTimer(int seconds); | 51 void StartAutoCloseTimer(int seconds); |
52 void StopAutoCloseTimer(); | 52 void StopAutoCloseTimer(); |
53 void RestartAutoCloseTimer(); | 53 void RestartAutoCloseTimer(); |
54 void Close(); | 54 void Close(); |
55 void SetVisible(bool is_visible); | 55 void SetVisible(bool is_visible); |
56 bool IsVisible(); | 56 bool IsVisible(); |
57 | 57 |
58 // Returns true if any of the SystemTrayItems return true from | 58 // Returns true if any of the SystemTrayItems return true from |
59 // ShouldShowLauncher(). | 59 // ShouldShowLauncher(). |
60 bool ShouldShowLauncher() const; | 60 bool ShouldShowLauncher() const; |
61 | 61 |
62 private: | 62 private: |
63 void CreateItemViews(user::LoginStatus login_status); | 63 void CreateItemViews(user::LoginStatus login_status); |
64 | 64 |
65 ash::SystemTray* tray_; | 65 ash::SystemTray* tray_; |
66 message_center::TrayBubbleView* bubble_view_; | 66 views::TrayBubbleView* bubble_view_; |
67 std::vector<ash::SystemTrayItem*> items_; | 67 std::vector<ash::SystemTrayItem*> items_; |
68 BubbleType bubble_type_; | 68 BubbleType bubble_type_; |
69 | 69 |
70 int autoclose_delay_; | 70 int autoclose_delay_; |
71 base::OneShotTimer<SystemTrayBubble> autoclose_; | 71 base::OneShotTimer<SystemTrayBubble> autoclose_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubble); | 73 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubble); |
74 }; | 74 }; |
75 | 75 |
76 } // namespace internal | 76 } // namespace internal |
77 } // namespace ash | 77 } // namespace ash |
78 | 78 |
79 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ | 79 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ |
OLD | NEW |