summaryrefslogtreecommitdiff
path: root/chromium/ash/public/mojom/voice_interaction_controller.mojom
blob: 8f19c8ebf856effb8139cb17e4efe5d76aefae61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// 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.

module ash.mojom;

// There is another copy of the VoiceInteractionState definition in
// //components/arc/mojom/voice_interaction_framework.mojom
// Please also update the other one if you change it.
// The duplicate definition is because we do not use extensible widely
// (crbug.com/731893).

// The initial state is NOT_READY, then it will either becomes STOPPED or
// RUNNING. If the mojo connection is lost, the state will be set back to
// NOT_READY.
enum VoiceInteractionState {
  // Voice interaction service is not ready yet, request sent will be waiting.
  NOT_READY = 0,
  // Voice interaction session is stopped.
  STOPPED,
  // Voice interaction session is currently running.
  RUNNING
};

enum AssistantAllowedState {
  // Assistant feature is allowed.
  ALLOWED = 0,
  // Disallowed because search and assistant is disabled by policy.
  DISALLOWED_BY_POLICY,
  // Disallowed because user's locale is not compatible.
  DISALLOWED_BY_LOCALE,
  // Disallowed because current user is not primary user.
  DISALLOWED_BY_NONPRIMARY_USER,
  // Disallowed because current user is supervised user.
  DISALLOWED_BY_SUPERVISED_USER,
  // Disallowed because incognito mode.
  DISALLOWED_BY_INCOGNITO,
  // Disallowed because the device is in demo mode.
  DISALLOWED_BY_DEMO_MODE,
  // Disallowed because the device is in public session.
  DISALLOWED_BY_PUBLIC_SESSION,
  // Disallowed because the user's account type is currently not supported.
  DISALLOWED_BY_ACCOUNT_TYPE,
  // Disallowed because the device is in Kiosk mode.
  DISALLOWED_BY_KIOSK_MODE
};

// Allows observing changes to voice interaction status and settings.
interface VoiceInteractionObserver {
  // Called when voice interaction session state changes.
  OnVoiceInteractionStatusChanged(VoiceInteractionState state);

  // Called when voice interaction is enabled/disabled in settings.
  OnVoiceInteractionSettingsEnabled(bool enabled);

  // Called when voice interaction service is allowed/disallowed to access
  // the "context" (text and graphic content that is currently on screen).
  OnVoiceInteractionContextEnabled(bool enabled);

  // Called when hotword listening is enabled/disabled.
  OnVoiceInteractionHotwordEnabled(bool enabled);

  // Called when assistant feature allowed state has changed.
  OnAssistantFeatureAllowedChanged(AssistantAllowedState state);

  // Called when Google Play Store is enabled/disabled.
  OnArcPlayStoreEnabledChanged(bool enabled);

  // Called when locale is changed in pref. The locale is in the format can be
  // "en-US" or simply "en". When locale is not set in pref, it returns empty
  // string.
  OnLocaleChanged(string locale);

  // Called when locked full screen state has changed.
  OnLockedFullScreenStateChanged(bool enabled);
};

// Interface for ash client (Chrome) to connect to the voice interaction
// controller, which notifies changes of voice interaction related flags.
interface VoiceInteractionController {
  // Add an observer.
  AddObserver(VoiceInteractionObserver observer);
};