OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 // Use the <code>chrome.usersPrivate</code> API to manage users. |
| 6 namespace usersPrivate { |
| 7 |
| 8 dictionary User { |
| 9 // Email for the user. |
| 10 DOMString email; |
| 11 |
| 12 // Whether this user is the device owner. |
| 13 boolean isOwner; |
| 14 }; |
| 15 |
| 16 callback UsersCallback = void (User[] users); |
| 17 callback UserAddedCallback = void (boolean success); |
| 18 callback UserRemovedCallback = void (boolean success); |
| 19 callback IsOwnerCallback = void (boolean isOwner); |
| 20 callback ManagedCallback = void (boolean managed); |
| 21 |
| 22 interface Functions { |
| 23 // Gets a list of the currently whitelisted users. |
| 24 static void getWhitelistedUsers(UsersCallback callback); |
| 25 |
| 26 // Adds a new user with the given email to the whitelist. |
| 27 // The callback is called with true if the user was added succesfully, or |
| 28 // with false if not (e.g. because the user was already present, or the |
| 29 // current user isn't the owner). |
| 30 static void addWhitelistedUser(DOMString email, UserAddedCallback callback); |
| 31 |
| 32 // Removes the user with the given email from the whitelist. |
| 33 // The callback is called with true if the user was removed succesfully, or |
| 34 // with false if not (e.g. because the user was not already present, or |
| 35 // the current user isn't the owner). |
| 36 static void removeWhitelistedUser(DOMString email, UserRemovedCallback callb
ack); |
| 37 |
| 38 // Whether the current user is the owner of the device. |
| 39 static void isCurrentUserOwner(IsOwnerCallback callback); |
| 40 |
| 41 // Whether the whitelist is managed by enterprise. |
| 42 static void isWhitelistManaged(ManagedCallback callback); |
| 43 }; |
| 44 }; |
OLD | NEW |