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 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "ash/system/tray/system_tray_bubble.h" | 9 #include "ash/system/tray/system_tray_bubble.h" |
10 #include "ash/system/tray/tray_background_view.h" | 10 #include "ash/system/tray/tray_background_view.h" |
11 #include "ash/system/user/login_status.h" | 11 #include "ash/system/user/login_status.h" |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/memory/scoped_vector.h" | 15 #include "base/memory/scoped_vector.h" |
16 #include "ui/views/bubble/tray_bubble_view.h" | 16 #include "ui/views/bubble/tray_bubble_view.h" |
17 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
18 | 18 |
19 #include <map> | 19 #include <map> |
20 #include <vector> | 20 #include <vector> |
21 | 21 |
22 namespace ash { | 22 namespace ash { |
| 23 class ScreenTrayItem; |
23 class SystemBubbleWrapper; | 24 class SystemBubbleWrapper; |
24 class SystemTrayDelegate; | 25 class SystemTrayDelegate; |
25 class SystemTrayItem; | 26 class SystemTrayItem; |
26 class TrayAccessibility; | 27 class TrayAccessibility; |
27 class TrayDate; | 28 class TrayDate; |
28 class TrayUser; | 29 class TrayUser; |
29 | 30 |
30 // There are different methods for creating bubble views. | 31 // There are different methods for creating bubble views. |
31 enum BubbleCreationType { | 32 enum BubbleCreationType { |
32 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. | 33 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 virtual void BubbleViewDestroyed() OVERRIDE; | 135 virtual void BubbleViewDestroyed() OVERRIDE; |
135 virtual void OnMouseEnteredView() OVERRIDE; | 136 virtual void OnMouseEnteredView() OVERRIDE; |
136 virtual void OnMouseExitedView() OVERRIDE; | 137 virtual void OnMouseExitedView() OVERRIDE; |
137 virtual base::string16 GetAccessibleNameForBubble() OVERRIDE; | 138 virtual base::string16 GetAccessibleNameForBubble() OVERRIDE; |
138 virtual gfx::Rect GetAnchorRect( | 139 virtual gfx::Rect GetAnchorRect( |
139 views::Widget* anchor_widget, | 140 views::Widget* anchor_widget, |
140 AnchorType anchor_type, | 141 AnchorType anchor_type, |
141 AnchorAlignment anchor_alignment) const OVERRIDE; | 142 AnchorAlignment anchor_alignment) const OVERRIDE; |
142 virtual void HideBubble(const views::TrayBubbleView* bubble_view) OVERRIDE; | 143 virtual void HideBubble(const views::TrayBubbleView* bubble_view) OVERRIDE; |
143 | 144 |
| 145 ScreenTrayItem* GetScreenShareItem() { return screen_share_tray_item_; } |
| 146 ScreenTrayItem* GetScreenCaptureItem() { return screen_capture_tray_item_; } |
| 147 |
144 TrayAccessibility* GetTrayAccessibilityForTest() { | 148 TrayAccessibility* GetTrayAccessibilityForTest() { |
145 return tray_accessibility_; | 149 return tray_accessibility_; |
146 } | 150 } |
147 | 151 |
148 // Get the tray item view (or NULL) for a given |tray_item| in a unit test. | 152 // Get the tray item view (or NULL) for a given |tray_item| in a unit test. |
149 views::View* GetTrayItemViewForTest(SystemTrayItem* tray_item); | 153 views::View* GetTrayItemViewForTest(SystemTrayItem* tray_item); |
150 | 154 |
151 // Gets tray_date_ for browser tests. | 155 // Gets tray_date_ for browser tests. |
152 TrayDate* GetTrayDateForTesting() const; | 156 TrayDate* GetTrayDateForTesting() const; |
153 | 157 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 bool hide_notifications_; | 229 bool hide_notifications_; |
226 | 230 |
227 // This is true when the displayed system tray menu is a full tray menu, | 231 // This is true when the displayed system tray menu is a full tray menu, |
228 // otherwise a single line item menu like the volume slider is shown. | 232 // otherwise a single line item menu like the volume slider is shown. |
229 // Note that the value is only valid when |system_bubble_| is true. | 233 // Note that the value is only valid when |system_bubble_| is true. |
230 bool full_system_tray_menu_; | 234 bool full_system_tray_menu_; |
231 | 235 |
232 TrayAccessibility* tray_accessibility_; // not owned | 236 TrayAccessibility* tray_accessibility_; // not owned |
233 TrayDate* tray_date_; | 237 TrayDate* tray_date_; |
234 | 238 |
| 239 // A reference to the Screen share and capture item. |
| 240 ScreenTrayItem* screen_capture_tray_item_; // not owned |
| 241 ScreenTrayItem* screen_share_tray_item_; // not owned |
| 242 |
235 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 243 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
236 }; | 244 }; |
237 | 245 |
238 } // namespace ash | 246 } // namespace ash |
239 | 247 |
240 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 248 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
OLD | NEW |