| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 module ash.mojom; |
| 6 |
| 7 // An action handler state. |
| 8 enum TrayActionState { |
| 9 // The client does not support the action. |
| 10 kNotSupported, |
| 11 |
| 12 // The client supports the action, but the action cannot be handled at the |
| 13 // moment, for example due to user session not being locked. |
| 14 kNotAvailable, |
| 15 |
| 16 // The client supports the action and is not currently handling the action. |
| 17 kAvailable, |
| 18 |
| 19 // The client received the request for the action and it is launching the |
| 20 // flow to handle it. |
| 21 kLaunching, |
| 22 |
| 23 // The client is currently handling the action. |
| 24 kActive, |
| 25 |
| 26 // The client is currently handling the action, but in background (e.g. the |
| 27 // handler window for the lock screen action was moved to the background and |
| 28 // appears underneath the login user pods). |
| 29 kBackground, |
| 30 }; |
| 31 |
| 32 // Used by a client (e.g. Chrome) to set up a handler for a tray action, and |
| 33 // notify ash on the action handler's state changes. A tray action is one of |
| 34 // predefined actions (currently only the "new note on lock screen" action is |
| 35 // supported) that appear as an ash status area button if the client declares |
| 36 // the action as available. Clicking the button invokes a client method that |
| 37 // requests the action associated with the button to be handled. |
| 38 interface TrayAction { |
| 39 // Sets the client to be used to handle action requests. |
| 40 // |lock_screen_note_state|: The current lock screen note action state |
| 41 // associated with the client. |
| 42 SetClient(TrayActionClient client, TrayActionState lock_screen_note_state); |
| 43 |
| 44 // Updates action state for the lock screen note action. If called with no |
| 45 // client set, the state change will not take effect until a client is set. |
| 46 // Null client is equivalent to kNotSupported state. |
| 47 UpdateLockScreenNoteState(TrayActionState state); |
| 48 }; |
| 49 |
| 50 // Used by ash to request Chrome to handle an action. |
| 51 interface TrayActionClient { |
| 52 // Requests a lock screen note action to be handled. |
| 53 RequestNewLockScreenNote(); |
| 54 }; |
| OLD | NEW |