| 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());
|
| }
|
|
|