| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_CAST_TRAY_CAST_H_ | 5 #ifndef ASH_SYSTEM_CAST_TRAY_CAST_H_ |
| 6 #define ASH_SYSTEM_CAST_TRAY_CAST_H_ | 6 #define ASH_SYSTEM_CAST_TRAY_CAST_H_ |
| 7 | 7 |
| 8 #include "ash/cast_config_delegate.h" | 8 #include "ash/cast_config_delegate.h" |
| 9 #include "ash/shell_observer.h" | 9 #include "ash/shell_observer.h" |
| 10 #include "ash/system/tray/system_tray_item.h" | 10 #include "ash/system/tray/system_tray_item.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override; | 41 void UpdateAfterShelfAlignmentChange(ShelfAlignment alignment) override; |
| 42 | 42 |
| 43 // Overridden from ShellObserver. | 43 // Overridden from ShellObserver. |
| 44 void OnCastingSessionStartedOrStopped(bool started) override; | 44 void OnCastingSessionStartedOrStopped(bool started) override; |
| 45 | 45 |
| 46 // Returns true if the cast extension was detected. | 46 // Returns true if the cast extension was detected. |
| 47 bool HasCastExtension(); | 47 bool HasCastExtension(); |
| 48 | 48 |
| 49 // Callback used to enable/disable the begin casting view depending on | 49 // Callback used to enable/disable the begin casting view depending on |
| 50 // if we have any cast receivers. | 50 // if we have any cast receivers. |
| 51 void UpdateCachedReceiverState( | 51 void OnReceiversUpdated( |
| 52 const CastConfigDelegate::ReceiversAndActivites& receivers_activities); | 52 const CastConfigDelegate::ReceiversAndActivites& receivers_activities); |
| 53 | 53 |
| 54 // This makes sure that the current view displayed in the tray is the correct | 54 // This makes sure that the current view displayed in the tray is the correct |
| 55 // one, depending on if we are currently casting. If we're casting, then a | 55 // one, depending on if we are currently casting. If we're casting, then a |
| 56 // view with a stop button is displayed; otherwise, a view that links to a | 56 // view with a stop button is displayed; otherwise, a view that links to a |
| 57 // detail view is displayed instead that allows the user to easily begin a | 57 // detail view is displayed instead that allows the user to easily begin a |
| 58 // casting session. | 58 // casting session. |
| 59 void UpdatePrimaryView(); | 59 void UpdatePrimaryView(); |
| 60 | 60 |
| 61 CastConfigDelegate::ReceiversAndActivites receivers_and_activities_; |
| 62 CastConfigDelegate::DeviceUpdateSubscription device_update_subscription_; |
| 63 bool is_casting_ = false; |
| 64 |
| 61 // Not owned. | 65 // Not owned. |
| 62 tray::CastTrayView* tray_ = nullptr; | 66 tray::CastTrayView* tray_ = nullptr; |
| 63 tray::CastDuplexView* default_ = nullptr; | 67 tray::CastDuplexView* default_ = nullptr; |
| 64 tray::CastDetailedView* detailed_ = nullptr; | 68 tray::CastDetailedView* detailed_ = nullptr; |
| 65 CastConfigDelegate* cast_config_delegate_; | |
| 66 | 69 |
| 67 bool has_cast_receivers_ = false; | |
| 68 bool is_casting_ = false; | |
| 69 base::WeakPtrFactory<TrayCast> weak_ptr_factory_; | 70 base::WeakPtrFactory<TrayCast> weak_ptr_factory_; |
| 70 | 71 |
| 71 DISALLOW_COPY_AND_ASSIGN(TrayCast); | 72 DISALLOW_COPY_AND_ASSIGN(TrayCast); |
| 72 }; | 73 }; |
| 73 | 74 |
| 74 } // namespace ash | 75 } // namespace ash |
| 75 | 76 |
| 76 #endif // ASH_SYSTEM_CAST_TRAY_CAST_H_ | 77 #endif // ASH_SYSTEM_CAST_TRAY_CAST_H_ |
| OLD | NEW |