diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-20 13:40:20 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-01-22 12:41:23 +0000 |
commit | 7961cea6d1041e3e454dae6a1da660b453efd238 (patch) | |
tree | c0eeb4a9ff9ba32986289c1653d9608e53ccb444 /chromium/ash/public/mojom | |
parent | b7034d0803538058e5c9d904ef03cf5eab34f6ef (diff) |
BASELINE: Update Chromium to 78.0.3904.130
Change-Id: If185e0c0061b3437531c97c9c8c78f239352a68b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/ash/public/mojom')
-rw-r--r-- | chromium/ash/public/mojom/BUILD.gn | 57 | ||||
-rw-r--r-- | chromium/ash/public/mojom/assistant_controller.mojom | 102 | ||||
-rw-r--r-- | chromium/ash/public/mojom/assistant_state_controller.mojom | 34 | ||||
-rw-r--r-- | chromium/ash/public/mojom/assistant_volume_control.mojom | 27 | ||||
-rw-r--r-- | chromium/ash/public/mojom/constants.mojom | 7 | ||||
-rw-r--r-- | chromium/ash/public/mojom/cros_display_config.mojom | 284 | ||||
-rw-r--r-- | chromium/ash/public/mojom/ime_controller.mojom | 104 | ||||
-rw-r--r-- | chromium/ash/public/mojom/ime_info.mojom | 40 | ||||
-rw-r--r-- | chromium/ash/public/mojom/tray_action.mojom | 102 | ||||
-rw-r--r-- | chromium/ash/public/mojom/voice_interaction_controller.mojom | 83 |
10 files changed, 840 insertions, 0 deletions
diff --git a/chromium/ash/public/mojom/BUILD.gn b/chromium/ash/public/mojom/BUILD.gn new file mode 100644 index 00000000000..118409980fd --- /dev/null +++ b/chromium/ash/public/mojom/BUILD.gn @@ -0,0 +1,57 @@ +# Copyright 2015 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. + +import("//mojo/public/tools/bindings/mojom.gni") + +mojom("mojom") { + disable_variants = true + + sources = [ + "assistant_controller.mojom", + "assistant_state_controller.mojom", + "assistant_volume_control.mojom", + "constants.mojom", + "cros_display_config.mojom", + "ime_controller.mojom", + "ime_info.mojom", + "tray_action.mojom", + "voice_interaction_controller.mojom", + ] + + public_deps = [ + "//chromeos/components/proximity_auth/public/mojom", + "//chromeos/services/assistant/public/mojom:notification", + "//components/account_id/mojom", + "//components/sync/mojom", + "//mojo/public/mojom/base", + "//services/content/public/mojom", + "//services/preferences/public/mojom", + "//skia/public/mojom", + "//ui/base/ime/chromeos/public/mojom", + "//ui/display/mojom:mojom", + "//ui/gfx/geometry/mojom", + "//ui/gfx/image/mojom", + "//ui/gfx/range/mojom", + "//url/mojom:url_mojom_gurl", + ] + + component_output_prefix = "ash_public_interfaces" + export_class_attribute = "ASH_PUBLIC_EXPORT" + export_define = "ASH_PUBLIC_IMPLEMENTATION=1" + export_header = "ash/public/cpp/ash_public_export.h" +} + +mojom("test_interfaces") { + testonly = true + disable_variants = true + sources = [ + "status_area_widget_test_api.test-mojom", + ] + deps = [ + ":mojom", + "//components/account_id/mojom", + "//mojo/public/mojom/base", + "//ui/gfx/geometry/mojom", + ] +} diff --git a/chromium/ash/public/mojom/assistant_controller.mojom b/chromium/ash/public/mojom/assistant_controller.mojom new file mode 100644 index 00000000000..bb7e017860d --- /dev/null +++ b/chromium/ash/public/mojom/assistant_controller.mojom @@ -0,0 +1,102 @@ +// 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 "chromeos/services/assistant/public/mojom/assistant_notification.mojom"; +import "mojo/public/mojom/base/time.mojom"; +import "ui/gfx/geometry/mojom/geometry.mojom"; + +enum AssistantTimerState { + kUnknown, + // The timer is scheduled to fire at some future date. + kScheduled, + // The timer will not fire but is kept in the queue of scheduled events; + // it can be resumed after which it will fire in |remaining_duration_ms|. + kPaused, + // The timer has fired. In the simplest case this means the timer has + // begun ringing. + kFired, +}; + +struct AssistantTimer { + string timer_id; + + // The current state of this timer. + AssistantTimerState state; + + // TODO(llin): Add more timer data. +}; + +// Assistant alarm/timer event type. +// Currently, the AlarmTimerManager maintains only one firing alarm/timer, +// the previous one will be dismissed if the second one firing. +enum AssistantAlarmTimerEventType { + kTimer + // TODO(llin): Add alarm event type. +}; + +union AlarmTimerData { + AssistantTimer timer_data; + // TODO(llin): Add alarm data. +}; + +// A composite struct that will hold exactly one alarm or timer. +struct AssistantAlarmTimerEvent { + AssistantAlarmTimerEventType type; + + AlarmTimerData? data; +}; + +// 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(); + + // Invoked when an alarm/timer state changed. No alarm/timer is ringing if + // |event| is nullptr. + OnAlarmTimerStateChanged(AssistantAlarmTimerEvent? event); +}; + +// 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); + + // Changes the quiet mode state in the message center. + SetQuietMode(bool enabled); +}; + +// 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); +}; diff --git a/chromium/ash/public/mojom/assistant_state_controller.mojom b/chromium/ash/public/mojom/assistant_state_controller.mojom new file mode 100644 index 00000000000..42b924f074b --- /dev/null +++ b/chromium/ash/public/mojom/assistant_state_controller.mojom @@ -0,0 +1,34 @@ +// Copyright 2019 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/mojom/voice_interaction_controller.mojom"; + +// Allows observing changes to Assistant status and settings. +interface AssistantStateObserver { + // Called when Assistant state changes. + OnAssistantStatusChanged(VoiceInteractionState state); + + // 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 (Assistant service) to connect to state controller, +// which notifies changes of Assistant status and settings. +interface AssistantStateController { + // Add an observer. + AddMojomObserver(AssistantStateObserver observer); +}; diff --git a/chromium/ash/public/mojom/assistant_volume_control.mojom b/chromium/ash/public/mojom/assistant_volume_control.mojom new file mode 100644 index 00000000000..e8bf405d627 --- /dev/null +++ b/chromium/ash/public/mojom/assistant_volume_control.mojom @@ -0,0 +1,27 @@ +// 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; + +// Interface to control system volume through Ash. +interface AssistantVolumeControl { + // Sets system volume to |volume|, which is between 0 - 100. + SetVolume(int32 volume, bool user_initiated); + + // Sets mute state to |muted|. + SetMuted(bool muted); + + // Adds volume observer. The observer will be immediately notified of volume + // and mute status when added. + AddVolumeObserver(VolumeObserver observer); +}; + +// Observes volume state changes. +interface VolumeObserver { + // Called when volume is updated. + OnVolumeChanged(int32 volume); + + // Called when mute state changed. + OnMuteStateChanged(bool muted); +}; diff --git a/chromium/ash/public/mojom/constants.mojom b/chromium/ash/public/mojom/constants.mojom new file mode 100644 index 00000000000..60c2a21ea15 --- /dev/null +++ b/chromium/ash/public/mojom/constants.mojom @@ -0,0 +1,7 @@ +// 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; + +const string kServiceName = "ash"; diff --git a/chromium/ash/public/mojom/cros_display_config.mojom b/chromium/ash/public/mojom/cros_display_config.mojom new file mode 100644 index 00000000000..774f0533c0d --- /dev/null +++ b/chromium/ash/public/mojom/cros_display_config.mojom @@ -0,0 +1,284 @@ +// 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 "ui/gfx/geometry/mojom/geometry.mojom"; +import "ui/display/mojom/display.mojom"; + +// All points, bounds, and insets are in display pixels unless otherwise +// sepcified. + +// SetDisplayLayoutInfo or SetDisplayProperties result. +enum DisplayConfigResult { + kSuccess = 0, + kInvalidOperationError, + kInvalidDisplayIdError, + kUnifiedNotEnabledError, + kPropertyValueOutOfRangeError, + kNotSupportedOnInternalDisplayError, + kNegativeValueError, + kSetDisplayModeError, + kInvalidDisplayLayoutError, + kMirrorModeSingleDisplayError, + kMirrorModeSourceIdError, + kMirrorModeDestIdError, + kCalibrationNotAvailableError, + kCalibrationNotStartedError, + kCalibrationInProgressError, + kCalibrationInvalidDataError, + kCalibrationFailedError, +}; + +// Describes how the displays are laid out. +enum DisplayLayoutMode { + // In normal mode displays are laid out as described by + // DisplayLayoutInfo.layouts. + kNormal = 0, + // In unified desktop mode, a single desktop will be stretched across all + // available displays. + kUnified, + // In mirrored mode, the display defined by DisplayLayoutInfo.mirrorSourceId + // will be mirrored in the displays defined by + // DisplayLayoutInfo.mirrorDestinationIds, or in all other displays if + // mirrorDestinationIds is empty. + kMirrored +}; + +// Describes a display edge. +enum DisplayLayoutPosition { + kTop = 0, + kRight, + kBottom, + kLeft +}; + +// Describes an overscan or touch calibration operation. +enum DisplayConfigOperation { + kStart = 0, + kAdjust, + kReset, + kComplete, + kShowNative, +}; + +// Describes who initiated configuration change. +enum DisplayConfigSource { + kUser = 0, + kPolicy +}; + +// Defines a pair of display + touch points used for touch calibration. +struct TouchCalibrationPair { + // The coordinates of the display point. + gfx.mojom.Point display_point; + // The coordinates of the touch point corresponding to the display point. + gfx.mojom.Point touch_point; +}; + +// Defines the data required for touch calibration. +struct TouchCalibration { + // Must contain exactly four pairs of touch calibration points. + array<TouchCalibrationPair> pairs; + // Width and height of the display area when the touch calibration was + // performed. + gfx.mojom.Size bounds; +}; + +// Defines the layout of a single display. +struct DisplayLayout { + // The unique identifier of the display. + string id; + // The unique identifier of the parent display. Empty for the root display. + string parent_id; + // The edge of the display that is shared with the parent display. Ignored for + // the root display. + DisplayLayoutPosition position; + // The offset of the display along the connected edge. 0 indicates that + // the topmost or leftmost corner is aligned. + int32 offset; +}; + +// Defines the layout mode and details. +struct DisplayLayoutInfo { + // The layout mode to use, see DisplayLayoutMode for details. + DisplayLayoutMode layout_mode; + // Ignored if If layout_mode is not kMirrored. Otherwise, if provided, + // specifies the unique identifier of the source display for mirroring. If + // not provided, mirror_destination_ids will be ignored and default ('normal') + // mirrored mode will be enabled. + string? mirror_source_id; + // Ignored if layout_mode is not kMirrored. Otherwise, if provided, specifies + // the unique identifiers of the displays to mirror the source display. If not + // provided or empty, all displays will mirror the source display. + array<string>? mirror_destination_ids; + // An array of layouts describing a directed graph of displays. Required if + // layout_mode is kNormal or kMirrored and not all displays are mirrored + // ('mixed' mode). Ignored if layout_mode is kUnified. + array<DisplayLayout>? layouts; +}; + +// EDID extracted parameters. Field description refers to "VESA ENHANCED +// EXTENDED DISPLAY IDENTIFICATION DATA STANDARD (Defines EDID Structure +// Version 1, Revision 4)" Release A, Revision 2 September 25, 2006. +// https://www.vesa.org/vesa-standards +struct Edid { + // Three character manufacturer code, Sec. 3.4.1 page 21. + string manufacturer_id; + // Two byte manufacturer-assigned code, Sec. 3.4.2 page 21. + string product_id; + // Year of manufacture. Sec. 3.4.4 page 22. + int32 year_of_manufacture; +}; + +// Struct wrapper so that the property can be optional. +struct DisplayRotation { + display.mojom.Rotation rotation; +}; + +// Defines the properties for a display mode, i.e. a valid size and scale. +struct DisplayMode { + // The display mode size in device independent (user visible) pixels. + gfx.mojom.Size size; + // The display mode size in native pixels. + gfx.mojom.Size size_in_native_pixels; + // The display mode device scale factor. + double device_scale_factor; + // The display mode refresh rate in hertz. + double refresh_rate; + // True if the mode is the display's native mode. + bool is_native; + // True if the mode is interlaced. + bool is_interlaced; +}; + +// Defines the properties of an individual display, returned by +// GetDisplayLayoutInfo. +struct DisplayUnitInfo { + // The unique identifier of the display. + string id; + // The user-friendly name (e.g. "Acme LCD monitor"). + string name; + // EDID properties when available. + Edid? edid; + // True if this is the primary display. + bool is_primary; + // True if this is an internal display. + bool is_internal; + // True if this display is enabled. + bool is_enabled; + // True when the display is in tablet mode. + bool is_tablet_mode; + // True if this display has a touch input device associated with it. + bool has_touch_support; + // True if this display has an accelerometer associated with it. + bool has_accelerometer_support; + // The number of pixels per inch along the x-axis. + double dpi_x; + // The number of pixels per inch along the y-axis. + double dpi_y; + // The display's clockwise rotation. + display.mojom.Rotation rotation; + // The display's logical bounds. + gfx.mojom.Rect bounds; + // The display's ovserscan insets within its screen's bounds. + gfx.mojom.Insets overscan; + // The usable work area of the display within the display bounds. Excludes + // areas of the display reserved for the OS, e.g. the taskbar and launcher. + gfx.mojom.Rect work_area; + // The index of the selected display mode. + int32 selected_display_mode_index; + // The list of available display modes. + array<DisplayMode> available_display_modes; + // The ratio between the display's current and default zoom. i.e. 1.0 is + // is equivalent to 100% zoom, and value 1.5 is equivalent to 150% zoom. + double display_zoom_factor; + // The list of allowed zoom factor values for the display. + array<double> available_display_zoom_factors; +}; + +// Properties for configuring an individual display, used in +// SetDisplayProperties. +struct DisplayConfigProperties { + // If true, makes the display primary. No-op if set to false. + bool set_primary; + // If provided, sets the display's overscan insets to the provided value. + // Note: overscan values may not be negative or larger than a half of the + // screen's size. Overscan cannot be changed on the internal monitor. + gfx.mojom.Insets? overscan; + // If provided updates the display's rotation. + DisplayRotation? rotation; + // If provided, updates the display's logical bounds origin. Note: when + // updating the display origin, some constraints will be applied. so the final + // bounds origin may be different than the one set. The actual bounds will be + // reflected in DisplayUnitInfo. Cannot be changed on the primary display (or + // if set_primary is true). + gfx.mojom.Point? bounds_origin; + // If non zero, updates the zoom associated with the display. This zoom + // performs relayout and repaint thus resulting in a better quality zoom than + // just performing a pixel by pixel stretch enlargement. + double display_zoom_factor; + // Optional DisplayMode properties to set. This should match one of the + // modes listed in DisplayUnitInfo.available_display_modes. Other custom + // modes may or may not be valid. + DisplayMode? display_mode; +}; + +// Interface for configuring displays in Chrome OS. Currently this is +// implemented in Ash through classes owned by ash::Shell, but the interface +// should not have any Ash specific dependencies. +interface CrosDisplayConfigController { + // Observers are notified when the display layout or any display properties + // change. + AddObserver(associated CrosDisplayConfigObserver observer); + + // Returns the display layout info, including the list of layouts. + GetDisplayLayoutInfo() => (DisplayLayoutInfo info); + + // Sets the layout mode, mirroring, and layouts. Returns kSuccess if the + // layout is valid or an error value otherwise. + SetDisplayLayoutInfo(DisplayLayoutInfo info) => (DisplayConfigResult result); + + // Returns the properties for all displays. If |single_unified| is true, a + // single display will be returned if the display layout is in unifed mode. + GetDisplayUnitInfoList(bool single_unified) => + (array<DisplayUnitInfo> info_list); + + // Sets |properties| for individual display with identifier |id|. |source| + // should describe who initiated the change. Returns Success if the properties + // are valid or an error value otherwise. + SetDisplayProperties(string id, + DisplayConfigProperties properties, + DisplayConfigSource source) => + (DisplayConfigResult result); + + // Enables or disables unified desktop mode. If the current display mode is + // kMirrored the mode will not be changed, if it is kNormal then the mode will + // be set to kUnified. + SetUnifiedDesktopEnabled(bool enabled); + + // Starts, updates, completes, or resets overscan calibration for the display + // with identifier |display_id|. If |op| is kAdjust, |delta| describes the + // amount to change the overscan value. Runs the callback after performing the + // operation or on error. + OverscanCalibration(string display_id, + DisplayConfigOperation op, + gfx.mojom.Insets? delta) => (DisplayConfigResult result); + + // Starts, completes, or resets touch calibration for the display with + // identifier |display_id|. If |op| is kShowNative shows the native + // calibration UI. Runs the callback after performing the operation or on + // error. + TouchCalibration(string display_id, + DisplayConfigOperation op, + TouchCalibration? calibration) => + (DisplayConfigResult result); +}; + +// Interface for clients needing to be informed when the display configuration +// changes. +interface CrosDisplayConfigObserver { + // Called any time the display configuration changes. + OnDisplayConfigChanged(); +}; diff --git a/chromium/ash/public/mojom/ime_controller.mojom b/chromium/ash/public/mojom/ime_controller.mojom new file mode 100644 index 00000000000..9edb3a69b12 --- /dev/null +++ b/chromium/ash/public/mojom/ime_controller.mojom @@ -0,0 +1,104 @@ +// 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; + +import "ash/public/mojom/ime_info.mojom"; +import "mojo/public/mojom/base/string16.mojom"; +import "ui/base/ime/chromeos/public/mojom/ime_keyset.mojom"; +import "ui/gfx/geometry/mojom/geometry.mojom"; + +// Interface for ash client (e.g. Chrome) to send input method info to ash. +interface ImeController { + // Sets the client interface. + SetClient(ImeControllerClient client); + + // Updates the cached IME information and refreshes the IME menus. + // |current_ime_id| is empty when there is no active IME yet. + RefreshIme(string current_ime_id, + array<ImeInfo> available_imes, + array<ImeMenuItem> menu_items); + + // Shows an icon in the IME menu indicating that IMEs are controlled by device + // policy. + SetImesManagedByPolicy(bool managed); + + // Shows the IME menu on the shelf instead of inside the system tray menu. + // Users with multiple IMEs that have multiple configurable properties (e.g. + // some Chinese IMEs) prefer this to keeping the IME menu under the primary + // system tray menu. + ShowImeMenuOnShelf(bool show); + + // Report caps lock state changes from chrome (which is the source of truth) + // to the tray. + UpdateCapsLockState(bool enabled); + + // Report keyboard layout changes from chrome (which is the source of truth) + // This is also called when a connection is first established between + // ImeController and ImeControllerClient. + // The layout name is a XKB keyboard layout name (e.g. "us"). + OnKeyboardLayoutNameChanged(string layout_name); + + // Report the enabled state of the various extra input options (currently + // emoji, handwriting, and voice input). |is_extra_input_options_enabled| set + // to false will disable all extra input option UI regardless of the enabled + // state of the individual options (which will be ingored). + SetExtraInputOptionsEnabledState(bool is_extra_input_options_enabled, + bool is_emoji_enabled, + bool is_handwriting_enabled, + bool is_voice_enabled); + + // Show the mode indicator view (e.g. a bubble with "DV" for Dvorak). + // The view fades out after a delay and close itself. + // The anchor bounds is in the universal screen coordinates in DIP. + ShowModeIndicator(gfx.mojom.Rect anchor_bounds, + mojo_base.mojom.String16 ime_short_name); +}; + +// Interface for ash to send input method requests to its client (e.g. Chrome). +interface ImeControllerClient { + // Switches to the next input method. Does nothing if only one input method + // is installed. + SwitchToNextIme(); + + // Switches to the last used input method. Does nothing if only one input + // method is installed. + SwitchToLastUsedIme(); + + // Switches to an input method by |id|. Does nothing if the input method is + // not installed. The ID is usually the output of a call like + // chromeos::extension_ime_util::GetInputMethodIDByEngineID("xkb:jp::jpn"), + // see that function for details. Shows a bubble with the input method short + // name when |show_message| is true. + SwitchImeById(string id, bool show_message); + + // Activates an input method menu item. The |key| must be a value from the + // ImeMenuItems provided via RefreshIme. Does nothing if the |key| is invalid. + ActivateImeMenuItem(string key); + + // When the caps lock state change originates from the tray (i.e. clicking the + // caps lock toggle from the settings menu from the caps lock icon), from an + // accelerator (e.g. pressing Alt + Search), or from the debug UI (i.e. + // toggling the caps lock button), propagate the change to the client without + // sending a change notification back. + // TODO(crbug/759435): Ideally this interaction should only be to disable the + // caps lock. + SetCapsLockEnabled(bool enabled); + + // Notifies the mirroring state change to the client where IME lives (e.g. + // Chrome), so that the IME can behave according to the state. + UpdateMirroringState(bool enabled); + + // Notifies the casting state change to the client where IME lives (e.g. + // Chrome), so that the IME can behave according to the state. + UpdateCastingState(bool enabled); + + // Overrides the keyboard keyset (emoji, handwriting or voice). If keyset is + // 'kNone', we switch to the default keyset. Because this is asynchronous, + // any code that needs the keyset to be updated first must use the callback. + OverrideKeyboardKeyset(chromeos.input_method.mojom.ImeKeyset keyset) => (); + + // Show the current mode. + ShowModeIndicator(); +}; diff --git a/chromium/ash/public/mojom/ime_info.mojom b/chromium/ash/public/mojom/ime_info.mojom new file mode 100644 index 00000000000..bd24bf85560 --- /dev/null +++ b/chromium/ash/public/mojom/ime_info.mojom @@ -0,0 +1,40 @@ +// 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; + +import "mojo/public/mojom/base/string16.mojom"; + +// Metadata about an installed input method. +struct ImeInfo { + // True if the IME is a third-party extension. + bool third_party; + + // ID that identifies the IME (e.g., "t:latn-post", "pinyin", "hangul"). + string id; + + // Long name of the IME, which is used as the user-visible name. + mojo_base.mojom.String16 name; + + // Medium name of the IME, which is the same as the short name in most cases. + mojo_base.mojom.String16 medium_name; + + // UI indicator for the IME (e.g., "US"). If the IME has no indicator, uses + // the first two characters in its preferred keyboard layout or language code + // (e.g., "ko", "ja", "en-US"). + mojo_base.mojom.String16 short_name; +}; + +// A menu item that sets an IME configuration property. +struct ImeMenuItem { + // True if the item is selected / enabled. + bool checked; + + // The key which identifies the property controlled by the menu item, e.g. + // "InputMode.HalfWidthKatakana". + string key; + + // The item label, e.g. "Switch to full punctuation mode" or "Hiragana". + mojo_base.mojom.String16 label; +}; diff --git a/chromium/ash/public/mojom/tray_action.mojom b/chromium/ash/public/mojom/tray_action.mojom new file mode 100644 index 00000000000..e366f9a1ec2 --- /dev/null +++ b/chromium/ash/public/mojom/tray_action.mojom @@ -0,0 +1,102 @@ +// 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; + +// An action handler state. +enum TrayActionState { + // The action cannot be handled - due to no client being set, the client not + // supporting the action, user session not being locked etc. + kNotAvailable, + + // The client supports the action and is not currently handling the action. + kAvailable, + + // The client received the request for the action and it is launching the + // flow to handle it. + kLaunching, + + // The client is currently handling the action. + kActive, +}; + +// The user action that triggered a request for a new note. +// Used in histograms - should be kept in sync with +// NewLockScreenNoteRequestType histogram enum, and assigned values should +// never be changed. +enum LockScreenNoteOrigin { + // The note request originated from the new note button in the system + // tray - note that this UI element is deprecated. + kTrayAction = 0, + + // The user tapped the note action button shown on the lock screen. + kLockScreenButtonTap = 1, + + // The user swiped from the note action button shown on the lock screen. + kLockScreenButtonSwipe = 2, + + // The user activated the lock screen button shown on the lock screen using + // the keyboard. + kLockScreenButtonKeyboard = 3, + + // The user ejected the stylus tool from the device. + kStylusEject = 4, +}; + +// Reason for closing a lock screen note, and consequentially closing any +// existing note handler app windows. +// Used primarily for metrics reporting. +// IMPORTANT: The values should be kept in sync with +// LockScreenNoteTakingExitReason histogram enum, and assigned values should +// never be changed. +enum CloseLockScreenNoteReason { + // The user session was unlocked. + kSessionUnlock = 0, + + // The user session was shut down (e.g. due to user sign-out). + kShutdown = 1, + + // The user display was completely dimmed (e.g. due to user inactivity). + kScreenDimmed = 2, + + // Device suspended. + kSuspend = 3, + + // The app window associated with the note was closed by the app. + kAppWindowClosed = 4, + + // The note taking app's support for the lock screen note taking was disabled + // (e.g. because of a policy update). + kAppLockScreenSupportDisabled = 5, + + // The user pressed "Unlock" button on the lock screen UI. + kUnlockButtonPressed = 6, +}; + +// Used by a client (e.g. Chrome) to set up a handler for a tray action, and +// notify ash on the action handler's state changes. A tray action is one of +// predefined actions (currently only the "new note on lock screen" action is +// supported) that appear as an ash status area button if the client declares +// the action as available. Clicking the button invokes a client method that +// requests the action associated with the button to be handled. +interface TrayAction { + // Sets the client to be used to handle action requests. + // |lock_screen_note_state|: The current lock screen note action state + // associated with the client. + SetClient(TrayActionClient client, TrayActionState lock_screen_note_state); + + // Updates action state for the lock screen note action. If called with no + // client set, the state change will not take effect until a client is set. + // Null client is equivalent to kNotAvailable state. + UpdateLockScreenNoteState(TrayActionState state); +}; + +// Used by ash to request Chrome to handle an action. +interface TrayActionClient { + // Requests a lock screen note action to be handled. + RequestNewLockScreenNote(LockScreenNoteOrigin origin); + + // Closes lock screen note. + CloseLockScreenNote(CloseLockScreenNoteReason reason); +}; diff --git a/chromium/ash/public/mojom/voice_interaction_controller.mojom b/chromium/ash/public/mojom/voice_interaction_controller.mojom new file mode 100644 index 00000000000..8f19c8ebf85 --- /dev/null +++ b/chromium/ash/public/mojom/voice_interaction_controller.mojom @@ -0,0 +1,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); +}; |