Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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 EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_MEDIA_PERCEPTION_API_MAN AGER_H_ | |
| 6 #define EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_MEDIA_PERCEPTION_API_MAN AGER_H_ | |
| 7 | |
| 8 #include "extensions/browser/browser_context_keyed_api_factory.h" | |
| 9 #include "extensions/common/api/media_perception_private.h" | |
| 10 | |
| 11 namespace mpp = extensions::api::media_perception_private; | |
| 12 | |
| 13 namespace extensions { | |
| 14 | |
| 15 class MediaPerceptionAPIManager : public BrowserContextKeyedAPI { | |
| 16 public: | |
| 17 explicit MediaPerceptionAPIManager(content::BrowserContext* context); | |
| 18 ~MediaPerceptionAPIManager() override; | |
| 19 | |
| 20 // Convenience method to get the MediaPeceptionAPIManager for a | |
| 21 // BrowserContext. | |
| 22 static MediaPerceptionAPIManager* Get(content::BrowserContext* context); | |
| 23 | |
| 24 // BrowserContextKeyedAPI implementation. | |
| 25 static BrowserContextKeyedAPIFactory<MediaPerceptionAPIManager>* | |
| 26 GetFactoryInstance(); | |
| 27 | |
| 28 // Triggers an onMediaPerception event on the JavaScript side, if the an event | |
| 29 // listener has been attached. | |
| 30 void TriggerOnMediaPerceptionEvent(); | |
| 31 | |
| 32 // The status of the media perception system. | |
| 33 mpp::Status status_; | |
|
bmayer
2017/04/13 17:41:59
Could this be made a private or protected member w
Luke Sorenson
2017/04/13 17:58:21
Yes, this should definitely be private especially
| |
| 34 | |
| 35 private: | |
| 36 friend class BrowserContextKeyedAPIFactory<MediaPerceptionAPIManager>; | |
| 37 | |
| 38 // BrowserContextKeyedAPI: | |
| 39 static const char* service_name() { return "MediaPerceptionAPIManager"; } | |
| 40 | |
| 41 content::BrowserContext* const browser_context_; | |
| 42 }; | |
| 43 | |
| 44 } // namespace extensions | |
| 45 | |
| 46 #endif // EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_MEDIA_PERCEPTION_API_ MANAGER_H_ | |
| OLD | NEW |