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

Unified Diff: chrome/browser/extensions/api/hotword_private/hotword_private_api.cc

Issue 1047973003: Notify hotwording extension of microphone state change. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/api/hotword_private/hotword_private_api.cc
diff --git a/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc b/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc
index d38013a83fd14dcef5528c3625214ee2a6957546..7ea2b0b6e8b60fd7e1d22f97e41bd134d3cb07b3 100644
--- a/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc
+++ b/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc
@@ -106,11 +106,21 @@ void HotwordPrivateEventService::OnSpeakerModelExists() {
SignalEvent(api::hotword_private::OnSpeakerModelExists::kEventName);
}
+void HotwordPrivateEventService::OnMicrophoneStateChanged(bool enabled) {
+ SignalEvent(api::hotword_private::OnMicrophoneStateChanged::kEventName,
+ api::hotword_private::OnMicrophoneStateChanged::Create(enabled));
+}
+
void HotwordPrivateEventService::SignalEvent(const std::string& event_name) {
+ SignalEvent(event_name, make_scoped_ptr(new base::ListValue()));
+}
+
+void HotwordPrivateEventService::SignalEvent(const std::string& event_name,
+ scoped_ptr<base::ListValue> args) {
EventRouter* router = EventRouter::Get(profile_);
if (!router || !router->HasEventListener(event_name))
return;
- scoped_ptr<base::ListValue> args(new base::ListValue());
+
scoped_ptr<Event> event(new Event(event_name, args.Pass()));
router->BroadcastEvent(event.Pass());
}

Powered by Google App Engine
This is Rietveld 408576698