| 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..63c5f691a60f5bfc8792545bd111105e6839a3e8
|
| --- /dev/null
|
| +++ b/ash/public/interfaces/tray_action.mojom
|
| @@ -0,0 +1,51 @@
|
| +// 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 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 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();
|
| +};
|
|
|