| 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/tray_background_view.h" | 10 #include "ash/system/tray/tray_background_view.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 // Accessors for testing. | 152 // Accessors for testing. |
| 153 | 153 |
| 154 // Returns true if the bubble exists. | 154 // Returns true if the bubble exists. |
| 155 bool CloseBubbleForTest() const; | 155 bool CloseBubbleForTest() const; |
| 156 | 156 |
| 157 // Overridden from TrayBackgroundView. | 157 // Overridden from TrayBackgroundView. |
| 158 virtual void Initialize() OVERRIDE; | 158 virtual void Initialize() OVERRIDE; |
| 159 virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; | 159 virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; |
| 160 virtual void AnchorUpdated() OVERRIDE; | 160 virtual void AnchorUpdated() OVERRIDE; |
| 161 virtual string16 GetAccessibleName() OVERRIDE; | 161 virtual string16 GetAccessibleName() OVERRIDE; |
| 162 virtual void HideBubbleWithView(const TrayBubbleView* bubble_view) OVERRIDE; |
| 163 virtual bool ClickedOutsideBubble() OVERRIDE; |
| 162 | 164 |
| 163 private: | 165 private: |
| 164 friend class internal::SystemTrayBubble; | 166 friend class internal::SystemTrayBubble; |
| 165 friend class internal::TrayGestureHandler; | 167 friend class internal::TrayGestureHandler; |
| 166 | 168 |
| 167 // Resets |bubble_| and clears any related state. | 169 // Resets |bubble_| and clears any related state. |
| 168 void DestroyBubble(); | 170 void DestroyBubble(); |
| 169 | 171 |
| 170 // Resets |notification_bubble_| and clears any related state. | 172 // Resets |notification_bubble_| and clears any related state. |
| 171 void DestroyNotificationBubble(); | 173 void DestroyNotificationBubble(); |
| 172 | 174 |
| 173 // Called when the widget associated with |bubble| closes. |bubble| should | |
| 174 // always == |bubble_|. This triggers destroying |bubble_| and hiding the | |
| 175 // launcher if necessary. | |
| 176 void RemoveBubble(internal::SystemTrayBubble* bubble); | |
| 177 | |
| 178 const ScopedVector<SystemTrayItem>& items() const { return items_; } | 175 const ScopedVector<SystemTrayItem>& items() const { return items_; } |
| 179 | 176 |
| 180 // Calculates the x-offset for the item in the tray. Returns -1 if its tray | 177 // Calculates the x-offset for the item in the tray. Returns -1 if its tray |
| 181 // item view is not visible. | 178 // item view is not visible. |
| 182 int GetTrayXOffset(SystemTrayItem* item) const; | 179 int GetTrayXOffset(SystemTrayItem* item) const; |
| 183 | 180 |
| 184 // Shows the default view and its arrow position is shifted by |x_offset|. | 181 // Shows the default view and its arrow position is shifted by |x_offset|. |
| 185 void ShowDefaultViewWithOffset(BubbleCreationType creation_type, | 182 void ShowDefaultViewWithOffset(BubbleCreationType creation_type, |
| 186 int x_offset); | 183 int x_offset); |
| 187 | 184 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 // Set to true when system notifications should be hidden (e.g. web | 235 // Set to true when system notifications should be hidden (e.g. web |
| 239 // notification bubble is visible). | 236 // notification bubble is visible). |
| 240 bool hide_notifications_; | 237 bool hide_notifications_; |
| 241 | 238 |
| 242 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 239 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
| 243 }; | 240 }; |
| 244 | 241 |
| 245 } // namespace ash | 242 } // namespace ash |
| 246 | 243 |
| 247 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 244 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
| OLD | NEW |