Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: chrome/browser/ui/ash/cast_config_delegate_media_router.h

Issue 2466043002: Cleanup TrayCast with media-router only support in mind. (Closed)
Patch Set: Add TODO Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/test/tray_cast_test_api.cc ('k') | chrome/browser/ui/ash/cast_config_delegate_media_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/ash/cast_config_delegate_media_router.h
diff --git a/chrome/browser/ui/ash/cast_config_delegate_media_router.h b/chrome/browser/ui/ash/cast_config_delegate_media_router.h
index c8f7265364a0a2d8c10463f30c0924112405ac56..95a5ff1bd854096313026ec149e13366da49eb1f 100644
--- a/chrome/browser/ui/ash/cast_config_delegate_media_router.h
+++ b/chrome/browser/ui/ash/cast_config_delegate_media_router.h
@@ -8,6 +8,8 @@
#include "ash/common/cast_config_delegate.h"
#include "base/macros.h"
#include "base/observer_list.h"
+#include "content/public/browser/notification_observer.h"
+#include "content/public/browser/notification_registrar.h"
namespace media_router {
class MediaRouter;
@@ -16,29 +18,34 @@ class MediaRouter;
class CastDeviceCache;
// A class which allows the ash tray to communicate with the media router.
-class CastConfigDelegateMediaRouter : public ash::CastConfigDelegate {
+class CastConfigDelegateMediaRouter : public ash::CastConfigDelegate,
+ public content::NotificationObserver {
public:
CastConfigDelegateMediaRouter();
~CastConfigDelegateMediaRouter() override;
- // The MediaRouter is not always enabled. We only use this backend when it is
- // enabled.
- static bool IsEnabled();
static void SetMediaRouterForTest(media_router::MediaRouter* media_router);
private:
// CastConfigDelegate:
void RequestDeviceRefresh() override;
- void CastToSink(const std::string& sink_id) override;
- void StopCasting(const std::string& route_id) override;
+ void CastToSink(const Sink& sink) override;
+ void StopCasting(const Route& route) override;
void AddObserver(ash::CastConfigDelegate::Observer* observer) override;
void RemoveObserver(ash::CastConfigDelegate::Observer* observer) override;
+ // content::NotificationObserver:
+ void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) override;
+
// |devices_| stores the current source/route status that we query from.
// This will return null until the media router is initialized.
CastDeviceCache* devices();
std::unique_ptr<CastDeviceCache> devices_;
+ content::NotificationRegistrar registrar_;
+
base::ObserverList<ash::CastConfigDelegate::Observer> observer_list_;
DISALLOW_COPY_AND_ASSIGN(CastConfigDelegateMediaRouter);
« no previous file with comments | « ash/test/tray_cast_test_api.cc ('k') | chrome/browser/ui/ash/cast_config_delegate_media_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698