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

Side by Side Diff: chrome/browser/extensions/api/cast_devices_private/cast_devices_private_api.h

Issue 2424183002: Remove Chromecast extension support from cast system tray menu. (Closed)
Patch Set: Additional removals 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 unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_CAST_DEVICES_PRIVATE_CAST_DEVICES_PRIVATE_ API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_CAST_DEVICES_PRIVATE_CAST_DEVICES_PRIVATE_ API_H_
7
8 #include <vector>
9
10 #include "ash/common/cast_config_delegate.h"
11 #include "base/callback_list.h"
12 #include "base/macros.h"
13 #include "base/observer_list.h"
14 #include "extensions/browser/browser_context_keyed_api_factory.h"
15 #include "extensions/browser/extension_function.h"
16
17 namespace extensions {
18
19 class CastDeviceUpdateListeners : public BrowserContextKeyedAPI {
20 public:
21 explicit CastDeviceUpdateListeners(content::BrowserContext* context);
22 ~CastDeviceUpdateListeners() override;
23
24 // Fetches an instance for the given context.
25 static CastDeviceUpdateListeners* Get(content::BrowserContext* context);
26
27 // Adds an observer that will be invoked when new device data is available.
28 void AddObserver(ash::CastConfigDelegate::Observer* observer);
29 void RemoveObserver(ash::CastConfigDelegate::Observer* observer);
30
31 // BrowserContextKeyedAPI implementation:
32 static BrowserContextKeyedAPIFactory<CastDeviceUpdateListeners>*
33 GetFactoryInstance();
34 static const bool kServiceIsCreatedWithBrowserContext = false;
35
36 private:
37 using ReceiverAndActivityList =
38 std::vector<ash::CastConfigDelegate::ReceiverAndActivity>;
39
40 friend class CastDevicesPrivateUpdateDevicesFunction; // For NotifyCallbacks.
41 void NotifyCallbacks(const ReceiverAndActivityList& devices);
42
43 base::ObserverList<ash::CastConfigDelegate::Observer> observer_list_;
44
45 friend class BrowserContextKeyedAPIFactory<CastDeviceUpdateListeners>;
46
47 // BrowserContextKeyedAPI implementation:
48 static const char* service_name() { return "CastDeviceUpdateListeners"; }
49
50 DISALLOW_COPY_AND_ASSIGN(CastDeviceUpdateListeners);
51 };
52
53 // static void updateDeviceState(ReceiverActivity[] devices);
54 class CastDevicesPrivateUpdateDevicesFunction :
55 public UIThreadExtensionFunction {
56 public:
57 CastDevicesPrivateUpdateDevicesFunction();
58
59 private:
60 ~CastDevicesPrivateUpdateDevicesFunction() override;
61
62 // ExtensionFunction:
63 ResponseAction Run() override;
64
65 DECLARE_EXTENSION_FUNCTION("cast.devicesPrivate.updateDevices",
66 CASTDEVICESPRIVATE_UPDATEDEVICES);
67 DISALLOW_COPY_AND_ASSIGN(CastDevicesPrivateUpdateDevicesFunction);
68 };
69
70 } // namespace extensions
71
72 #endif // CHROME_BROWSER_EXTENSIONS_API_CAST_DEVICES_PRIVATE_CAST_DEVICES_PRIVA TE_API_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698