Chromium Code Reviews| 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..d2c27e3cf3872400fc29b377156134614693da8c |
| --- /dev/null |
| +++ b/ash/public/interfaces/tray_action.mojom |
| @@ -0,0 +1,50 @@ |
| +// 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. |
| + // handler window for lock screen action was moved to the background to |
| + // surfeace user sign-in UI). |
|
James Cook
2017/05/05 02:55:44
nit: surface
Or rewrite as: "(e.g. the handler wi
tbarzic
2017/05/05 04:46:26
Done.
|
| + kBackground, |
| +}; |
| + |
| +// Used by a client (e.g. Chrome) to notify ash of tray action handlers’ |
| +// state changes. |
|
James Cook
2017/05/05 02:55:44
nit: I would also say what a tray action is. For e
tbarzic
2017/05/05 04:46:26
Done.
|
| +interface TrayAction { |
|
James Cook
2017/05/05 02:55:44
optional: This API is OK for now, but in the long
tbarzic
2017/05/05 04:46:26
Yes, I think this would be a good approach when we
|
| + // 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 kNoteSupported state. |
|
James Cook
2017/05/05 02:55:44
kNotSupported
tbarzic
2017/05/05 04:46:26
Done.
|
| + 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(); |
| +}; |