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

Side by Side Diff: chrome/browser/ui/ash/cast_config_delegate_media_router.h

Issue 1567103005: Replace base::CallbackList with base::ObserverList in CastConfigDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Add DLL export to fix windows build Created 4 years, 11 months 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 unified diff | Download patch
OLDNEW
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 CHROME_BROWSER_UI_ASH_CAST_CONFIG_DELEGATE_MEDIA_ROUTER_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_CAST_CONFIG_DELEGATE_MEDIA_ROUTER_H_
6 #define CHROME_BROWSER_UI_ASH_CAST_CONFIG_DELEGATE_MEDIA_ROUTER_H_ 6 #define CHROME_BROWSER_UI_ASH_CAST_CONFIG_DELEGATE_MEDIA_ROUTER_H_
7 7
8 #include "ash/cast_config_delegate.h" 8 #include "ash/cast_config_delegate.h"
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/observer_list.h"
10 11
11 namespace media_router { 12 namespace media_router {
12 class MediaRouter; 13 class MediaRouter;
13 } 14 }
14 15
15 class CastDeviceCache; 16 class CastDeviceCache;
16 17
17 // A class which allows the ash tray to communicate with the media router. 18 // A class which allows the ash tray to communicate with the media router.
18 class CastConfigDelegateMediaRouter : public ash::CastConfigDelegate { 19 class CastConfigDelegateMediaRouter : public ash::CastConfigDelegate {
19 public: 20 public:
20 CastConfigDelegateMediaRouter(); 21 CastConfigDelegateMediaRouter();
21 ~CastConfigDelegateMediaRouter() override; 22 ~CastConfigDelegateMediaRouter() override;
22 23
23 // The MediaRouter is not always enabled. We only use this backend when it is 24 // The MediaRouter is not always enabled. We only use this backend when it is
24 // enabled. 25 // enabled.
25 static bool IsEnabled(); 26 static bool IsEnabled();
26 static void SetMediaRouterForTest(media_router::MediaRouter* media_router); 27 static void SetMediaRouterForTest(media_router::MediaRouter* media_router);
27 28
28 private: 29 private:
29 // CastConfigDelegate: 30 // CastConfigDelegate:
30 bool HasCastExtension() const override; 31 bool HasCastExtension() const override;
31 DeviceUpdateSubscription RegisterDeviceUpdateObserver( 32
achuithb 2016/01/13 09:21:25 remove whitespace? Also I'd prefer Add/Remove Obse
jdufault 2016/01/13 19:43:26 Done.
32 const ReceiversAndActivitesCallback& callback) override; 33 void AddObserver(ash::CastConfigDelegate::Observer* observer) override;
34 void RemoveObserver(ash::CastConfigDelegate::Observer* observer) override;
33 void RequestDeviceRefresh() override; 35 void RequestDeviceRefresh() override;
34 void CastToReceiver(const std::string& receiver_id) override; 36 void CastToReceiver(const std::string& receiver_id) override;
35 void StopCasting(const std::string& route_id) override; 37 void StopCasting(const std::string& route_id) override;
36 bool HasOptions() const override; 38 bool HasOptions() const override;
37 void LaunchCastOptions() override; 39 void LaunchCastOptions() override;
38 40
39 // |devices_| stores the current source/route status that we query from. 41 // |devices_| stores the current source/route status that we query from.
40 // This will return null until the media router is initialized. 42 // This will return null until the media router is initialized.
41 CastDeviceCache* devices(); 43 CastDeviceCache* devices();
42 scoped_ptr<CastDeviceCache> devices_; 44 scoped_ptr<CastDeviceCache> devices_;
43 45
44 base::CallbackList<void(const ReceiversAndActivities&)> callback_list_; 46 base::ObserverList<ash::CastConfigDelegate::Observer> observer_list_;
45 47
46 DISALLOW_COPY_AND_ASSIGN(CastConfigDelegateMediaRouter); 48 DISALLOW_COPY_AND_ASSIGN(CastConfigDelegateMediaRouter);
47 }; 49 };
48 50
49 #endif // CHROME_BROWSER_UI_ASH_CAST_CONFIG_DELEGATE_MEDIA_ROUTER_H_ 51 #endif // CHROME_BROWSER_UI_ASH_CAST_CONFIG_DELEGATE_MEDIA_ROUTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698