| 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" |
| 11 #include "ash/system/tray/tray_views.h" | 11 #include "ash/system/tray/tray_views.h" |
| 12 #include "ash/system/user/login_status.h" | 12 #include "ash/system/user/login_status.h" |
| 13 #include "ash/wm/shelf_auto_hide_behavior.h" |
| 13 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 14 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 15 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 16 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
| 17 #include "ui/views/view.h" | 18 #include "ui/views/view.h" |
| 18 | 19 |
| 19 #include <map> | 20 #include <map> |
| 20 #include <vector> | 21 #include <vector> |
| 21 | 22 |
| 22 namespace ash { | 23 namespace ash { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 33 class NetworkObserver; | 34 class NetworkObserver; |
| 34 class PowerStatusObserver; | 35 class PowerStatusObserver; |
| 35 class UpdateObserver; | 36 class UpdateObserver; |
| 36 class UserObserver; | 37 class UserObserver; |
| 37 | 38 |
| 38 class SystemTrayItem; | 39 class SystemTrayItem; |
| 39 | 40 |
| 40 namespace internal { | 41 namespace internal { |
| 41 class SystemTrayBackground; | 42 class SystemTrayBackground; |
| 42 class SystemTrayBubble; | 43 class SystemTrayBubble; |
| 44 class SystemTrayContainer; |
| 43 class SystemTrayLayerAnimationObserver; | 45 class SystemTrayLayerAnimationObserver; |
| 44 } | 46 } |
| 45 | 47 |
| 46 // There are different methods for creating bubble views. | 48 // There are different methods for creating bubble views. |
| 47 enum BubbleCreationType { | 49 enum BubbleCreationType { |
| 48 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. | 50 BUBBLE_CREATE_NEW, // Closes any existing bubble and creates a new one. |
| 49 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one. | 51 BUBBLE_USE_EXISTING, // Uses any existing bubble, or creates a new one. |
| 50 }; | 52 }; |
| 51 | 53 |
| 52 class ASH_EXPORT SystemTray : public internal::ActionableView, | 54 class ASH_EXPORT SystemTray : public internal::ActionableView, |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 } | 146 } |
| 145 UserObserver* user_observer() const { | 147 UserObserver* user_observer() const { |
| 146 return user_observer_; | 148 return user_observer_; |
| 147 } | 149 } |
| 148 | 150 |
| 149 // Accessors for testing. | 151 // Accessors for testing. |
| 150 | 152 |
| 151 // Returns true if the bubble exists. | 153 // Returns true if the bubble exists. |
| 152 bool CloseBubbleForTest() const; | 154 bool CloseBubbleForTest() const; |
| 153 | 155 |
| 156 void SetShelfAlignment(ShelfAlignment alignment); |
| 157 ShelfAlignment shelf_alignment() const { return shelf_alignment_; } |
| 158 |
| 154 private: | 159 private: |
| 155 friend class internal::SystemTrayLayerAnimationObserver; | 160 friend class internal::SystemTrayLayerAnimationObserver; |
| 156 friend class internal::SystemTrayBubble; | 161 friend class internal::SystemTrayBubble; |
| 157 | 162 |
| 158 // Called when the widget associated with |bubble| closes. |bubble| should | 163 // Called when the widget associated with |bubble| closes. |bubble| should |
| 159 // always == |bubble_|. This triggers destroying |bubble_| and hiding the | 164 // always == |bubble_|. This triggers destroying |bubble_| and hiding the |
| 160 // launcher if necessary. | 165 // launcher if necessary. |
| 161 void RemoveBubble(internal::SystemTrayBubble* bubble); | 166 void RemoveBubble(internal::SystemTrayBubble* bubble); |
| 162 | 167 |
| 163 const ScopedVector<SystemTrayItem>& items() const { return items_; } | 168 const ScopedVector<SystemTrayItem>& items() const { return items_; } |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 198 virtual void UpdateBackground(int alpha) OVERRIDE; | 203 virtual void UpdateBackground(int alpha) OVERRIDE; |
| 199 | 204 |
| 200 // Owned items. | 205 // Owned items. |
| 201 ScopedVector<SystemTrayItem> items_; | 206 ScopedVector<SystemTrayItem> items_; |
| 202 | 207 |
| 203 // Pointers to members of |items_|. | 208 // Pointers to members of |items_|. |
| 204 SystemTrayItem* detailed_item_; | 209 SystemTrayItem* detailed_item_; |
| 205 std::vector<SystemTrayItem*> notification_items_; | 210 std::vector<SystemTrayItem*> notification_items_; |
| 206 | 211 |
| 207 // The container for all the tray views of the items. | 212 // The container for all the tray views of the items. |
| 208 views::View* tray_container_; | 213 internal::SystemTrayContainer* tray_container_; |
| 209 | 214 |
| 210 // Mappings of system tray item and it's view in the tray. | 215 // Mappings of system tray item and it's view in the tray. |
| 211 std::map<SystemTrayItem*, views::View*> tray_item_map_; | 216 std::map<SystemTrayItem*, views::View*> tray_item_map_; |
| 212 | 217 |
| 213 // These observers are not owned by the tray. | 218 // These observers are not owned by the tray. |
| 214 AccessibilityObserver* accessibility_observer_; | 219 AccessibilityObserver* accessibility_observer_; |
| 215 AudioObserver* audio_observer_; | 220 AudioObserver* audio_observer_; |
| 216 BluetoothObserver* bluetooth_observer_; | 221 BluetoothObserver* bluetooth_observer_; |
| 217 BrightnessObserver* brightness_observer_; | 222 BrightnessObserver* brightness_observer_; |
| 218 CapsLockObserver* caps_lock_observer_; | 223 CapsLockObserver* caps_lock_observer_; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 233 | 238 |
| 234 // Buble for notifications. | 239 // Buble for notifications. |
| 235 scoped_ptr<internal::SystemTrayBubble> notification_bubble_; | 240 scoped_ptr<internal::SystemTrayBubble> notification_bubble_; |
| 236 | 241 |
| 237 // Owned by the view it's installed on. | 242 // Owned by the view it's installed on. |
| 238 internal::SystemTrayBackground* background_; | 243 internal::SystemTrayBackground* background_; |
| 239 | 244 |
| 240 // See description agove getter. | 245 // See description agove getter. |
| 241 bool should_show_launcher_; | 246 bool should_show_launcher_; |
| 242 | 247 |
| 248 // Shelf alignment. |
| 249 ShelfAlignment shelf_alignment_; |
| 250 |
| 243 internal::BackgroundAnimator hide_background_animator_; | 251 internal::BackgroundAnimator hide_background_animator_; |
| 244 internal::BackgroundAnimator hover_background_animator_; | 252 internal::BackgroundAnimator hover_background_animator_; |
| 245 scoped_ptr<internal::SystemTrayLayerAnimationObserver> | 253 scoped_ptr<internal::SystemTrayLayerAnimationObserver> |
| 246 layer_animation_observer_; | 254 layer_animation_observer_; |
| 247 | 255 |
| 248 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 256 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
| 249 }; | 257 }; |
| 250 | 258 |
| 251 } // namespace ash | 259 } // namespace ash |
| 252 | 260 |
| 253 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 261 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
| OLD | NEW |