Index: ash/system/cast/tray_cast.h |
diff --git a/ash/system/cast/tray_cast.h b/ash/system/cast/tray_cast.h |
index a14877702bb068011aea6e6a9a0344bde1d931a5..2137fc0f05fc9ad6eb8a20d607ff07ddec2b7014 100644 |
--- a/ash/system/cast/tray_cast.h |
+++ b/ash/system/cast/tray_cast.h |
@@ -9,7 +9,6 @@ |
#include "ash/shell_observer.h" |
#include "ash/system/tray/system_tray_item.h" |
#include "base/macros.h" |
-#include "base/memory/weak_ptr.h" |
namespace ash { |
namespace tray { |
@@ -19,7 +18,9 @@ class CastDetailedView; |
class CastDuplexView; |
} // namespace tray |
-class ASH_EXPORT TrayCast : public SystemTrayItem, public ShellObserver { |
+class ASH_EXPORT TrayCast : public SystemTrayItem, |
+ public ShellObserver, |
+ public CastConfigDelegate::Observer { |
public: |
explicit TrayCast(SystemTray* system_tray); |
~TrayCast() override; |
@@ -50,10 +51,9 @@ class ASH_EXPORT TrayCast : public SystemTrayItem, public ShellObserver { |
// Returns true if the cast extension was detected. |
bool HasCastExtension(); |
- // Callback used to enable/disable the begin casting view depending on |
- // if we have any cast receivers. |
- void OnReceiversUpdated( |
- const CastConfigDelegate::ReceiversAndActivities& receivers_activities); |
+ // Overridden from CastConfigDelegate::Observer. |
achuithb
2016/01/13 09:21:25
Maybe move this to after OnCastingSessionStartedOr
jdufault
2016/01/13 19:43:26
Done.
|
+ void OnDevicesUpdated( |
+ const CastConfigDelegate::ReceiversAndActivities& devices) override; |
// This makes sure that the current view displayed in the tray is the correct |
// one, depending on if we are currently casting. If we're casting, then a |
@@ -63,16 +63,15 @@ class ASH_EXPORT TrayCast : public SystemTrayItem, public ShellObserver { |
void UpdatePrimaryView(); |
CastConfigDelegate::ReceiversAndActivities receivers_and_activities_; |
- CastConfigDelegate::DeviceUpdateSubscription device_update_subscription_; |
bool is_casting_ = false; |
+ bool added_observer_ = false; |
+ |
// Not owned. |
tray::CastTrayView* tray_ = nullptr; |
tray::CastDuplexView* default_ = nullptr; |
tray::CastDetailedView* detailed_ = nullptr; |
- base::WeakPtrFactory<TrayCast> weak_ptr_factory_; |
- |
DISALLOW_COPY_AND_ASSIGN(TrayCast); |
}; |