| 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/power/power_supply_status.h" | 9 #include "ash/system/power/power_supply_status.h" |
| 10 #include "ash/system/tray/system_tray_bubble.h" | 10 #include "ash/system/tray/system_tray_bubble.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // Temporarily hides/unhides the notification bubble. | 105 // Temporarily hides/unhides the notification bubble. |
| 106 void SetHideNotifications(bool hidden); | 106 void SetHideNotifications(bool hidden); |
| 107 | 107 |
| 108 // Returns true if the launcher should be forced visible when auto-hidden. | 108 // Returns true if the launcher should be forced visible when auto-hidden. |
| 109 bool ShouldShowLauncher() const; | 109 bool ShouldShowLauncher() const; |
| 110 | 110 |
| 111 // Returns true if there is a system bubble (already visible or in the process | 111 // Returns true if there is a system bubble (already visible or in the process |
| 112 // of being created). | 112 // of being created). |
| 113 bool HasSystemBubble() const; | 113 bool HasSystemBubble() const; |
| 114 | 114 |
| 115 // Returns true if the system_bubble_ exists and is of type |type|. |
| 116 bool HasSystemBubbleType(internal::SystemTrayBubble::BubbleType type); |
| 117 |
| 115 // Returns a pointer to the system bubble or NULL if none. | 118 // Returns a pointer to the system bubble or NULL if none. |
| 116 internal::SystemTrayBubble* GetSystemBubble(); | 119 internal::SystemTrayBubble* GetSystemBubble(); |
| 117 | 120 |
| 118 // Returns true if any bubble is visible. | 121 // Returns true if any bubble is visible. |
| 119 bool IsAnyBubbleVisible() const; | 122 bool IsAnyBubbleVisible() const; |
| 120 | 123 |
| 121 // Returns true if the mouse is inside the notification bubble. | 124 // Returns true if the mouse is inside the notification bubble. |
| 122 bool IsMouseInNotificationBubble() const; | 125 bool IsMouseInNotificationBubble() const; |
| 123 | 126 |
| 124 // Accessors for testing. | 127 // Accessors for testing. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 145 virtual void HideBubble(const views::TrayBubbleView* bubble_view) OVERRIDE; | 148 virtual void HideBubble(const views::TrayBubbleView* bubble_view) OVERRIDE; |
| 146 | 149 |
| 147 internal::TrayAccessibility* GetTrayAccessibilityForTest() { | 150 internal::TrayAccessibility* GetTrayAccessibilityForTest() { |
| 148 return tray_accessibility_; | 151 return tray_accessibility_; |
| 149 } | 152 } |
| 150 | 153 |
| 151 private: | 154 private: |
| 152 // Creates the default set of items for the sytem tray. | 155 // Creates the default set of items for the sytem tray. |
| 153 void CreateItems(SystemTrayDelegate* delegate); | 156 void CreateItems(SystemTrayDelegate* delegate); |
| 154 | 157 |
| 155 // Returns true if the system_bubble_ exists and is of type |type|. | |
| 156 bool HasSystemBubbleType(internal::SystemTrayBubble::BubbleType type); | |
| 157 | |
| 158 // Resets |system_bubble_| and clears any related state. | 158 // Resets |system_bubble_| and clears any related state. |
| 159 void DestroySystemBubble(); | 159 void DestroySystemBubble(); |
| 160 | 160 |
| 161 // Resets |notification_bubble_| and clears any related state. | 161 // Resets |notification_bubble_| and clears any related state. |
| 162 void DestroyNotificationBubble(); | 162 void DestroyNotificationBubble(); |
| 163 | 163 |
| 164 // Calculates the x-offset for the item in the tray. Returns -1 if its tray | 164 // Calculates the x-offset for the item in the tray. Returns -1 if its tray |
| 165 // item view is not visible. | 165 // item view is not visible. |
| 166 int GetTrayXOffset(SystemTrayItem* item) const; | 166 int GetTrayXOffset(SystemTrayItem* item) const; |
| 167 | 167 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 bool hide_notifications_; | 210 bool hide_notifications_; |
| 211 | 211 |
| 212 internal::TrayAccessibility* tray_accessibility_; // not owned | 212 internal::TrayAccessibility* tray_accessibility_; // not owned |
| 213 | 213 |
| 214 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 214 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
| 215 }; | 215 }; |
| 216 | 216 |
| 217 } // namespace ash | 217 } // namespace ash |
| 218 | 218 |
| 219 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 219 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
| OLD | NEW |