| 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/ash_export.h" | 9 #include "ash/ash_export.h" |
| 10 #include "ash/system/tray/tray_background_view.h" | 10 #include "ash/system/tray/tray_background_view.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" | |
| 14 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 15 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 16 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/scoped_vector.h" | 16 #include "base/memory/scoped_vector.h" |
| 18 #include "ui/views/view.h" | 17 #include "ui/views/view.h" |
| 19 | 18 |
| 20 #include <map> | 19 #include <map> |
| 21 #include <vector> | 20 #include <vector> |
| 22 | 21 |
| 23 namespace ash { | 22 namespace ash { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 88 |
| 90 // Hides the notification view for |item|. | 89 // Hides the notification view for |item|. |
| 91 void HideNotificationView(SystemTrayItem* item); | 90 void HideNotificationView(SystemTrayItem* item); |
| 92 | 91 |
| 93 // Updates the items when the login status of the system changes. | 92 // Updates the items when the login status of the system changes. |
| 94 void UpdateAfterLoginStatusChange(user::LoginStatus login_status); | 93 void UpdateAfterLoginStatusChange(user::LoginStatus login_status); |
| 95 | 94 |
| 96 // Updates the items when the shelf alignment changes. | 95 // Updates the items when the shelf alignment changes. |
| 97 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment); | 96 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment); |
| 98 | 97 |
| 98 // Temporarily hides/unhides the notification bubble. |
| 99 void SetHideNotifications(bool hidden); |
| 100 |
| 101 // Returns true if the primary bubble is visible. |
| 102 bool IsBubbleVisible() const; |
| 103 |
| 99 // Returns true if the launcher should show. | 104 // Returns true if the launcher should show. |
| 100 bool should_show_launcher() const { | 105 bool should_show_launcher() const { |
| 101 return bubble_.get() && should_show_launcher_; | 106 return bubble_.get() && should_show_launcher_; |
| 102 } | 107 } |
| 103 | 108 |
| 104 AccessibilityObserver* accessibility_observer() const { | 109 AccessibilityObserver* accessibility_observer() const { |
| 105 return accessibility_observer_; | 110 return accessibility_observer_; |
| 106 } | 111 } |
| 107 AudioObserver* audio_observer() const { | 112 AudioObserver* audio_observer() const { |
| 108 return audio_observer_; | 113 return audio_observer_; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 139 } | 144 } |
| 140 UserObserver* user_observer() const { | 145 UserObserver* user_observer() const { |
| 141 return user_observer_; | 146 return user_observer_; |
| 142 } | 147 } |
| 143 | 148 |
| 144 // Accessors for testing. | 149 // Accessors for testing. |
| 145 | 150 |
| 146 // Returns true if the bubble exists. | 151 // Returns true if the bubble exists. |
| 147 bool CloseBubbleForTest() const; | 152 bool CloseBubbleForTest() const; |
| 148 | 153 |
| 149 void SetShelfAlignment(ShelfAlignment alignment); | 154 // Overridden from TrayBackgroundView. |
| 150 ShelfAlignment shelf_alignment() const { return shelf_alignment_; } | 155 virtual void SetShelfAlignment(ShelfAlignment alignment) OVERRIDE; |
| 151 | 156 |
| 152 private: | 157 private: |
| 153 friend class internal::SystemTrayLayerAnimationObserver; | 158 friend class internal::SystemTrayLayerAnimationObserver; |
| 154 friend class internal::SystemTrayBubble; | 159 friend class internal::SystemTrayBubble; |
| 155 | 160 |
| 156 // Resets |bubble_| and clears any related state. | 161 // Resets |bubble_| and clears any related state. |
| 157 void DestroyBubble(); | 162 void DestroyBubble(); |
| 158 | 163 |
| 159 // Called when the widget associated with |bubble| closes. |bubble| should | 164 // Called when the widget associated with |bubble| closes. |bubble| should |
| 160 // always == |bubble_|. This triggers destroying |bubble_| and hiding the | 165 // always == |bubble_|. This triggers destroying |bubble_| and hiding the |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 | 232 |
| 228 // Bubble for default and detailed views. | 233 // Bubble for default and detailed views. |
| 229 scoped_ptr<internal::SystemTrayBubble> bubble_; | 234 scoped_ptr<internal::SystemTrayBubble> bubble_; |
| 230 | 235 |
| 231 // Buble for notifications. | 236 // Buble for notifications. |
| 232 scoped_ptr<internal::SystemTrayBubble> notification_bubble_; | 237 scoped_ptr<internal::SystemTrayBubble> notification_bubble_; |
| 233 | 238 |
| 234 // See description agove getter. | 239 // See description agove getter. |
| 235 bool should_show_launcher_; | 240 bool should_show_launcher_; |
| 236 | 241 |
| 237 // Shelf alignment. | |
| 238 ShelfAlignment shelf_alignment_; | |
| 239 | |
| 240 scoped_ptr<internal::SystemTrayLayerAnimationObserver> | 242 scoped_ptr<internal::SystemTrayLayerAnimationObserver> |
| 241 layer_animation_observer_; | 243 layer_animation_observer_; |
| 242 | 244 |
| 243 // Keep track of the default view height so that when we create detailed | 245 // Keep track of the default view height so that when we create detailed |
| 244 // views directly (e.g. from a notification) we know what height to use. | 246 // views directly (e.g. from a notification) we know what height to use. |
| 245 int default_bubble_height_; | 247 int default_bubble_height_; |
| 246 | 248 |
| 249 // Set to true when system notifications should be hidden (e.g. web |
| 250 // notification bubble is visible). |
| 251 bool hide_notifications_; |
| 252 |
| 247 DISALLOW_COPY_AND_ASSIGN(SystemTray); | 253 DISALLOW_COPY_AND_ASSIGN(SystemTray); |
| 248 }; | 254 }; |
| 249 | 255 |
| 250 } // namespace ash | 256 } // namespace ash |
| 251 | 257 |
| 252 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ | 258 #endif // ASH_SYSTEM_TRAY_SYSTEM_TRAY_H_ |
| OLD | NEW |