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_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 5 #ifndef ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 6 #define ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 base::string16 GetAccessibleNameForTray() override; | 140 base::string16 GetAccessibleNameForTray() override; |
141 void BubbleResized(const views::TrayBubbleView* bubble_view) override; | 141 void BubbleResized(const views::TrayBubbleView* bubble_view) override; |
142 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; | 142 void HideBubbleWithView(const views::TrayBubbleView* bubble_view) override; |
143 void ClickedOutsideBubble() override; | 143 void ClickedOutsideBubble() override; |
144 | 144 |
145 // views::TrayBubbleView::Delegate: | 145 // views::TrayBubbleView::Delegate: |
146 void BubbleViewDestroyed() override; | 146 void BubbleViewDestroyed() override; |
147 void OnMouseEnteredView() override; | 147 void OnMouseEnteredView() override; |
148 void OnMouseExitedView() override; | 148 void OnMouseExitedView() override; |
149 base::string16 GetAccessibleNameForBubble() override; | 149 base::string16 GetAccessibleNameForBubble() override; |
150 gfx::Rect GetAnchorRect(views::Widget* anchor_widget, | |
151 AnchorType anchor_type, | |
152 AnchorAlignment anchor_alignment) const override; | |
153 void OnBeforeBubbleWidgetInit( | 150 void OnBeforeBubbleWidgetInit( |
154 views::Widget* anchor_widget, | 151 views::Widget* anchor_widget, |
155 views::Widget* bubble_widget, | 152 views::Widget* bubble_widget, |
156 views::Widget::InitParams* params) const override; | 153 views::Widget::InitParams* params) const override; |
157 void HideBubble(const views::TrayBubbleView* bubble_view) override; | 154 void HideBubble(const views::TrayBubbleView* bubble_view) override; |
158 | 155 |
159 ScreenTrayItem* GetScreenShareItem() { return screen_share_tray_item_; } | 156 ScreenTrayItem* GetScreenShareItem() { return screen_share_tray_item_; } |
160 ScreenTrayItem* GetScreenCaptureItem() { return screen_capture_tray_item_; } | 157 ScreenTrayItem* GetScreenCaptureItem() { return screen_capture_tray_item_; } |
161 | 158 |
162 TrayAccessibility* GetTrayAccessibilityForTest() { | 159 TrayAccessibility* GetTrayAccessibilityForTest() { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 // Resets |system_bubble_| and clears any related state. | 191 // Resets |system_bubble_| and clears any related state. |
195 void DestroySystemBubble(); | 192 void DestroySystemBubble(); |
196 | 193 |
197 // Resets |notification_bubble_| and clears any related state. | 194 // Resets |notification_bubble_| and clears any related state. |
198 void DestroyNotificationBubble(); | 195 void DestroyNotificationBubble(); |
199 | 196 |
200 // Returns a string with the current time for accessibility on the status | 197 // Returns a string with the current time for accessibility on the status |
201 // tray bar. | 198 // tray bar. |
202 base::string16 GetAccessibleTimeString(const base::Time& now) const; | 199 base::string16 GetAccessibleTimeString(const base::Time& now) const; |
203 | 200 |
204 // Calculates the x-offset for the item in the tray. Returns -1 if its tray | |
205 // item view is not visible. | |
206 int GetTrayXOffset(SystemTrayItem* item) const; | |
207 | |
208 // Shows the default view and its arrow position is shifted by |x_offset|. | |
209 void ShowDefaultViewWithOffset(BubbleCreationType creation_type, | |
210 int x_offset, | |
211 bool persistent); | |
212 | |
213 // Constructs or re-constructs |system_bubble_| and populates it with |items|. | 201 // Constructs or re-constructs |system_bubble_| and populates it with |items|. |
214 // Specify |change_tray_status| to true if want to change the tray background | 202 // Specify |change_tray_status| to true if want to change the tray background |
215 // status. The bubble will be opened in inactive state. If |can_activate| is | 203 // status. The bubble will be opened in inactive state. If |can_activate| is |
216 // true, the bubble will be activated by one of following means. | 204 // true, the bubble will be activated by one of following means. |
217 // * When alt/alt-tab acclerator is used to start navigation. | 205 // * When alt/alt-tab acclerator is used to start navigation. |
218 // * When the bubble is opened by accelerator. | 206 // * When the bubble is opened by accelerator. |
219 // * When the tray item is set to be focused. | 207 // * When the tray item is set to be focused. |
220 void ShowItems(const std::vector<SystemTrayItem*>& items, | 208 void ShowItems(const std::vector<SystemTrayItem*>& items, |
221 bool details, | 209 bool details, |
222 bool can_activate, | 210 bool can_activate, |
223 BubbleCreationType creation_type, | 211 BubbleCreationType creation_type, |
224 int x_offset, | |
225 bool persistent); | 212 bool persistent); |
226 | 213 |
227 // Constructs or re-constructs |notification_bubble_| and populates it with | 214 // Constructs or re-constructs |notification_bubble_| and populates it with |
228 // |notification_items_|, or destroys it if there are no notification items. | 215 // |notification_items_|, or destroys it if there are no notification items. |
229 void UpdateNotificationBubble(); | 216 void UpdateNotificationBubble(); |
230 | 217 |
231 // Checks the current status of the system tray and updates the web | 218 // Checks the current status of the system tray and updates the web |
232 // notification tray according to the current status. | 219 // notification tray according to the current status. |
233 void UpdateWebNotifications(); | 220 void UpdateWebNotifications(); |
234 | 221 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 std::unique_ptr<KeyEventWatcher> key_event_watcher_; | 282 std::unique_ptr<KeyEventWatcher> key_event_watcher_; |
296 | 283 |
297 std::unique_ptr<ActivationObserver> activation_observer_; | 284 std::unique_ptr<ActivationObserver> activation_observer_; |
298 | 285 |
299 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 286 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
300 }; | 287 }; |
301 | 288 |
302 } // namespace ash | 289 } // namespace ash |
303 | 290 |
304 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 291 #endif // ASH_COMMON_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
OLD | NEW |