| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ash/launcher/background_animator.h" | 9 #include "ash/launcher/background_animator.h" |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 // Returns true if the bubble exists. | 153 // Returns true if the bubble exists. |
| 154 bool CloseBubbleForTest() const; | 154 bool CloseBubbleForTest() const; |
| 155 | 155 |
| 156 void SetShelfAlignment(ShelfAlignment alignment); | 156 void SetShelfAlignment(ShelfAlignment alignment); |
| 157 ShelfAlignment shelf_alignment() const { return shelf_alignment_; } | 157 ShelfAlignment shelf_alignment() const { return shelf_alignment_; } |
| 158 | 158 |
| 159 private: | 159 private: |
| 160 friend class internal::SystemTrayLayerAnimationObserver; | 160 friend class internal::SystemTrayLayerAnimationObserver; |
| 161 friend class internal::SystemTrayBubble; | 161 friend class internal::SystemTrayBubble; |
| 162 | 162 |
| 163 // Resets |bubble_| and clears any related state. |
| 164 void DestroyBubble(); |
| 165 |
| 163 // Called when the widget associated with |bubble| closes. |bubble| should | 166 // Called when the widget associated with |bubble| closes. |bubble| should |
| 164 // always == |bubble_|. This triggers destroying |bubble_| and hiding the | 167 // always == |bubble_|. This triggers destroying |bubble_| and hiding the |
| 165 // launcher if necessary. | 168 // launcher if necessary. |
| 166 void RemoveBubble(internal::SystemTrayBubble* bubble); | 169 void RemoveBubble(internal::SystemTrayBubble* bubble); |
| 167 | 170 |
| 168 const ScopedVector<SystemTrayItem>& items() const { return items_; } | 171 const ScopedVector<SystemTrayItem>& items() const { return items_; } |
| 169 | 172 |
| 170 // Calculates the x-offset for the item in the tray. Returns -1 if its tray | 173 // Calculates the x-offset for the item in the tray. Returns -1 if its tray |
| 171 // item view is not visible. | 174 // item view is not visible. |
| 172 int GetTrayXOffset(SystemTrayItem* item) const; | 175 int GetTrayXOffset(SystemTrayItem* item) const; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 bool should_show_launcher_; | 249 bool should_show_launcher_; |
| 247 | 250 |
| 248 // Shelf alignment. | 251 // Shelf alignment. |
| 249 ShelfAlignment shelf_alignment_; | 252 ShelfAlignment shelf_alignment_; |
| 250 | 253 |
| 251 internal::BackgroundAnimator hide_background_animator_; | 254 internal::BackgroundAnimator hide_background_animator_; |
| 252 internal::BackgroundAnimator hover_background_animator_; | 255 internal::BackgroundAnimator hover_background_animator_; |
| 253 scoped_ptr<internal::SystemTrayLayerAnimationObserver> | 256 scoped_ptr<internal::SystemTrayLayerAnimationObserver> |
| 254 layer_animation_observer_; | 257 layer_animation_observer_; |
| 255 | 258 |
| 259 // Keep track of the default view height so that when we create detailed |
| 260 // views directly (e.g. from a notification) we know what height to use. |
| 261 int default_bubble_height_; |
| 262 |
| 256 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 263 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
| 257 }; | 264 }; |
| 258 | 265 |
| 259 } // namespace ash | 266 } // namespace ash |
| 260 | 267 |
| 261 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 268 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
| OLD | NEW |