blob: 12e5b788d2d6f4414f36f096c499e0893c8cdbed [file] [log] [blame]
// Copyright 2018 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.
module ash.mojom;
import "ash/public/interfaces/assistant_image_downloader.mojom";
import "ash/public/interfaces/assistant_setup.mojom";
import "chromeos/services/assistant/public/mojom/assistant.mojom";
import "ui/gfx/geometry/mojo/geometry.mojom";
// Interface to AssistantController which is owned by Shell in Ash. This is
// typically used by the Assistant service to provide the controller with an
// interface to itself, as well as by the Assistant client in chrome/browser to
// provide interfaces to delegates which depend on browser.
interface AssistantController {
// Provides a reference to the underlying |assistant| service.
SetAssistant(chromeos.assistant.mojom.Assistant assistant);
// Provides an interface to the |assistant_image_downloader| owned by
// AssistantClient.
SetAssistantImageDownloader(
AssistantImageDownloader assistant_image_downloader);
// Opens Google Assistant settings.
OpenAssistantSettings();
// Show speaker id enrollment flow.
StartSpeakerIdEnrollmentFlow();
// Send Assistant feedback to Assistant server. If |pii_allowed| is
// true then the user gives permission to attach Assistant debug info.
// |feedback_description| is user's feedback input.
SendAssistantFeedback(
bool pii_allowed, string feedback_description);
};
// Interface to the AssistantAlarmTimerController which is owned by the
// AssistantController. Currently used by the Assistant service to notify Ash
// of changes to the underlying alarm/timer state in LibAssistant.
interface AssistantAlarmTimerController {
// Invoked when a timer has started sounding.
OnTimerSoundingStarted();
// Invoked when a timer has finished sounding.
OnTimerSoundingFinished();
};
// Interface to the AssistantNotificationController which is owned by the
// AssistantController. Currently used by the Assistant service to modify
// Assistant notification state in Ash in response to LibAssistant events.
interface AssistantNotificationController {
// Requests that the specified |notification| be added or updated. If the
// |client_id| for |notification| matches that of an existing notification,
// an update will occur. Otherwise, a new notification will be added.
AddOrUpdateNotification(
chromeos.assistant.mojom.AssistantNotification notification);
// Requests that the notification uniquely identified by |id| be removed. If
// |from_server| is true the request to remove was initiated by the server.
RemoveNotificationById(string id, bool from_server);
// Requests that all notifications associated with the given |grouping_key|
// be removed. If |from_server| is true the request to remove was initiated
// by the server.
RemoveNotificationByGroupingKey(string grouping_key, bool from_server);
// Requests that all notifications be removed. If |from_server| is true the
// request was initiated by the server.
RemoveAllNotifications(bool from_server);
};
// Interface to the AssistantScreenContextController which is owned by the
// AssistantController. Currently used by the Assistant service to request
// screenshots.
interface AssistantScreenContextController {
// Requests a screenshot of the region enclosed by |rect| and returns the
// screenshot encoded in JPEG format. If |rect| is empty, it returns a
// fullscreen screenshot.
RequestScreenshot(gfx.mojom.Rect rect) => (array<uint8> screenshot);
};
// Interface to the AssistantSetupController which is owned by the
// AssistantController. Currently used by AssistantSetup in chrome/browser
// to provide an interface to itself. This is used for triggering a runtime
// onboarding flow.
interface AssistantSetupController {
// Provides an interface to the |assistant_setup| owned by AssistantClient
// in chrome/browser.
SetAssistantSetup(AssistantSetup assistant_setup);
};