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" | 8 #include "ash/system/tray/tray_bubble_view.h" |
9 #include "ash/system/user/login_status.h" | 9 #include "ash/system/user/login_status.h" |
10 #include "ash/wm/shelf_types.h" | 10 #include "ash/wm/shelf_types.h" |
11 #include "base/base_export.h" | 11 #include "base/base_export.h" |
12 #include "base/timer.h" | 12 #include "base/timer.h" |
13 #include "ui/views/widget/widget.h" | 13 #include "ui/views/widget/widget_observer.h" |
14 | 14 |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 namespace ash { | 17 namespace ash { |
18 | 18 |
19 class SystemTray; | 19 class SystemTray; |
20 class SystemTrayItem; | 20 class SystemTrayItem; |
21 | 21 |
22 namespace internal { | 22 namespace internal { |
23 | 23 |
24 class SystemTrayBubble : public TrayBubbleView::Host, | 24 class SystemTrayBubble : public TrayBubbleView::Host, |
25 public views::Widget::Observer { | 25 public views::WidgetObserver { |
26 public: | 26 public: |
27 enum BubbleType { | 27 enum BubbleType { |
28 BUBBLE_TYPE_DEFAULT, | 28 BUBBLE_TYPE_DEFAULT, |
29 BUBBLE_TYPE_DETAILED, | 29 BUBBLE_TYPE_DETAILED, |
30 BUBBLE_TYPE_NOTIFICATION | 30 BUBBLE_TYPE_NOTIFICATION |
31 }; | 31 }; |
32 | 32 |
33 enum AnchorType { | 33 enum AnchorType { |
34 ANCHOR_TYPE_TRAY, | 34 ANCHOR_TYPE_TRAY, |
35 ANCHOR_TYPE_BUBBLE | 35 ANCHOR_TYPE_BUBBLE |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 void StartAutoCloseTimer(int seconds); | 73 void StartAutoCloseTimer(int seconds); |
74 void StopAutoCloseTimer(); | 74 void StopAutoCloseTimer(); |
75 void RestartAutoCloseTimer(); | 75 void RestartAutoCloseTimer(); |
76 void Close(); | 76 void Close(); |
77 void SetVisible(bool is_visible); | 77 void SetVisible(bool is_visible); |
78 bool IsVisible(); | 78 bool IsVisible(); |
79 | 79 |
80 private: | 80 private: |
81 void CreateItemViews(user::LoginStatus login_status); | 81 void CreateItemViews(user::LoginStatus login_status); |
82 | 82 |
83 // Overridden from views::Widget::Observer. | 83 // Overridden from views::WidgetObserver: |
84 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; | 84 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
85 | 85 |
86 ash::SystemTray* tray_; | 86 ash::SystemTray* tray_; |
87 TrayBubbleView* bubble_view_; | 87 TrayBubbleView* bubble_view_; |
88 views::Widget* bubble_widget_; | 88 views::Widget* bubble_widget_; |
89 std::vector<ash::SystemTrayItem*> items_; | 89 std::vector<ash::SystemTrayItem*> items_; |
90 BubbleType bubble_type_; | 90 BubbleType bubble_type_; |
91 AnchorType anchor_type_; | 91 AnchorType anchor_type_; |
92 | 92 |
93 int autoclose_delay_; | 93 int autoclose_delay_; |
94 base::OneShotTimer<SystemTrayBubble> autoclose_; | 94 base::OneShotTimer<SystemTrayBubble> autoclose_; |
95 | 95 |
96 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubble); | 96 DISALLOW_COPY_AND_ASSIGN(SystemTrayBubble); |
97 }; | 97 }; |
98 | 98 |
99 } // namespace internal | 99 } // namespace internal |
100 } // namespace ash | 100 } // namespace ash |
101 | 101 |
102 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ | 102 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_BUBBLE_H_ |
OLD | NEW |