Index: extensions/browser/api/media_perception_private/media_perception_api_manager.h |
diff --git a/extensions/browser/api/media_perception_private/media_perception_api_manager.h b/extensions/browser/api/media_perception_private/media_perception_api_manager.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..58aebff13da240f7de24c8a22be806ccd98cc573 |
--- /dev/null |
+++ b/extensions/browser/api/media_perception_private/media_perception_api_manager.h |
@@ -0,0 +1,46 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_MEDIA_PERCEPTION_API_MANAGER_H_ |
+#define EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_MEDIA_PERCEPTION_API_MANAGER_H_ |
+ |
+#include "extensions/browser/browser_context_keyed_api_factory.h" |
+#include "extensions/common/api/media_perception_private.h" |
+ |
+namespace mpp = extensions::api::media_perception_private; |
+ |
+namespace extensions { |
+ |
+class MediaPerceptionAPIManager : public BrowserContextKeyedAPI { |
+ public: |
+ explicit MediaPerceptionAPIManager(content::BrowserContext* context); |
+ ~MediaPerceptionAPIManager() override; |
+ |
+ // Convenience method to get the MediaPeceptionAPIManager for a |
+ // BrowserContext. |
+ static MediaPerceptionAPIManager* Get(content::BrowserContext* context); |
+ |
+ // BrowserContextKeyedAPI implementation. |
+ static BrowserContextKeyedAPIFactory<MediaPerceptionAPIManager>* |
+ GetFactoryInstance(); |
+ |
+ // Triggers an onMediaPerception event on the JavaScript side, if the an event |
+ // listener has been attached. |
+ void TriggerOnMediaPerceptionEvent(); |
+ |
+ // The status of the media perception system. |
+ 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
|
+ |
+ private: |
+ friend class BrowserContextKeyedAPIFactory<MediaPerceptionAPIManager>; |
+ |
+ // BrowserContextKeyedAPI: |
+ static const char* service_name() { return "MediaPerceptionAPIManager"; } |
+ |
+ content::BrowserContext* const browser_context_; |
+}; |
+ |
+} // namespace extensions |
+ |
+#endif // EXTENSIONS_BROWSER_API_MEDIA_PERCEPTION_PRIVATE_MEDIA_PERCEPTION_API_MANAGER_H_ |