+
+void HotwordService::RequestHotwordSession(HotwordClient* client) {
+#if defined(ENABLE_EXTENSIONS)
+ if (!IsServiceAvailable() || client_)
+ return;
+
+ client_ = client;
+
+ HotwordPrivateEventService* event_service =
+ BrowserContextKeyedAPIFactory<HotwordPrivateEventService>::Get(profile_);
+ if (event_service)
+ event_service->OnHotwordSessionRequested();
+#endif
+}
+
+void HotwordService::StopHotwordSession(HotwordClient* client) {
+#if defined(ENABLE_EXTENSIONS)
+ if (!IsServiceAvailable())
+ return;
+
+ DCHECK(client_ == client);
+
+ client_ = NULL;
+ HotwordPrivateEventService* event_service =
+ BrowserContextKeyedAPIFactory<HotwordPrivateEventService>::Get(profile_);
+ if (event_service)
+ event_service->OnHotwordSessionStopped();
+#endif
+}