blob: a58732b79f0349f05db9658186219b744373ebd0 [file] [log] [blame]
// 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/interfaces/user_info.mojom";
import "chromeos/components/proximity_auth/public/interfaces/auth_type.mojom";
import "mojo/public/mojom/base/string16.mojom";
import "mojo/public/mojom/base/values.mojom";
// Supported multi-profile user behavior values.
// Keep in sync with the enum in md_user_pod_row.js and user_pod_row.js
enum MultiProfileUserBehavior {
UNRESTRICTED = 0,
PRIMARY_ONLY = 1,
NOT_ALLOWED = 2,
OWNER_PRIMARY_ONLY = 3,
};
// Easy unlock icon choices.
enum EasyUnlockIconId {
// No icon shown.
NONE,
// The user has clicked the easy unlock icon and disabled easy unlock for this
// login/lock session.
HARDLOCKED,
// Phone could not be found.
LOCKED,
// Phone found, but it is not unlocked.
LOCKED_TO_BE_ACTIVATED,
// Phone found, but it is too far away.
LOCKED_WITH_PROXIMITY_HINT,
// Phone found and unlocked. The user can click to dismiss the login/lock
// screen.
UNLOCKED,
// Scanning for phone.
SPINNER,
};
// The status of fingerprint availability.
enum FingerprintState {
// The user cannot use fingerprint. This may be because:
// - they are not the primary user
// - they never registered fingerprint
// - the device does not have a fingerprint sensor
UNAVAILABLE,
// Fingerprint can be used to unlock the device.
AVAILABLE,
// There have been too many attempts, so now fingerprint is disabled.
DISABLED_FROM_ATTEMPTS,
// It has been too long since the device was last used.
DISABLED_FROM_TIMEOUT,
};
// Information about the custom icon in the user pod.
struct EasyUnlockIconOptions {
// Icon that should be displayed.
EasyUnlockIconId icon;
// Tooltip that is associated with the icon. This is shown automatically if
// |autoshow_tooltip| is true. The user can always see the tooltip if they
// hover over the icon. The tooltip should be used for the accessibility label
// if it is present.
mojo_base.mojom.String16 tooltip;
// If true, the tooltip should be displayed (even if the user is not currently
// hovering over the icon, ie, this makes |tooltip| act like a little like a
// notification).
bool autoshow_tooltip;
// Accessibility label. Only used if |tooltip| is empty.
// TODO(jdufault): Always populate and use |aria_label|, even if |tooltip| is
// non-empty.
mojo_base.mojom.String16 aria_label;
// If true, clicking the easy unlock icon should fire a hardlock event which
// will disable easy unlock. The hardlock event will request a new icon
// display via a separate EasyUnlockIconsOption update. See
// login_screen.mojom::HardlockPod.
bool hardlock_on_click;
};
// Infomation of each input method. This is used to populate keyboard layouts
// for public account user.
struct InputMethodItem {
// An id that identifies an input method engine (e.g., "t:latn-post",
// "pinyin", "hangul").
string ime_id;
// Title of the imput method.
string title;
// Whether this input method is been selected.
bool selected;
};
// Information of each available locale. This is used to populate language
// locales for public account user.
struct LocaleItem {
// Language code of the locale.
string language_code;
// Title of the locale.
string title;
// Optional, group name of the locale.
string? group_name;
};
// Infomation about a public account user.
struct PublicAccountInfo {
// Optional, the domain name displayed in the login screen UI.
string? enterprise_domain;
// A list of available user locales.
array<LocaleItem> available_locales;
// Default locale for this user.
string default_locale;
// Show expanded user view that contains session information/warnings and
// locale selection.
bool show_expanded_view;
// Show the advanced expanded user view if there are at least two recommended
// locales. This will be the case in multilingual environments where users
// are likely to want to choose among locales.
bool show_advanced_view;
// A list of available keyboard layouts.
array<InputMethodItem> keyboard_layouts;
};
// Info about a user in login/lock screen.
struct LoginUserInfo {
// User's basic information including account id, email, avatar etc.
UserInfo basic_user_info;
// What method the user can use to sign in.
proximity_auth.mojom.AuthType auth_type;
// True if this user has already signed in.
bool is_signed_in;
// True if this user is the device owner.
bool is_device_owner;
// The initial fingerprint state. There are other mojom methods (ie,
// login_screen.mojom::SetFingerprintState) which update the current state.
FingerprintState fingerprint_state;
// True if multi-profiles sign in is allowed for this user.
bool is_multiprofile_allowed;
// Enforced policy for multi-profiles sign in.
MultiProfileUserBehavior multiprofile_policy;
// True if this user can be removed.
bool can_remove;
// Optional, contains the public account information if user type is
// PUBLIC_ACCOUNT.
PublicAccountInfo? public_account_info;
};