| Index: ash/public/interfaces/tray_action.mojom
|
| diff --git a/ash/public/interfaces/tray_action.mojom b/ash/public/interfaces/tray_action.mojom
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..f99db56e12b10a17cf91d761bb1c1828ad5ff39c
|
| --- /dev/null
|
| +++ b/ash/public/interfaces/tray_action.mojom
|
| @@ -0,0 +1,54 @@
|
| +// 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 client does not support the action.
|
| + kNotSupported,
|
| +
|
| + // The client supports the action, but the action cannot be handled at the
|
| + // moment, for example due to user session not being locked.
|
| + 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 client is currently handling the action, but in background (e.g. the
|
| + // handler window for the lock screen action was moved to the background and
|
| + // appears underneath the login user pods).
|
| + kBackground,
|
| +};
|
| +
|
| +// 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 kNotSupported 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();
|
| +};
|
|
|