Chromium Code Reviews| 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 owner. Only specified if the current user (i.e. | |
| 13 // the one performing the method call to get users) is the owner. | |
| 14 boolean? isOwner; | |
|
Ken Rockot(use gerrit already)
2015/06/01 19:14:45
nit: IMHO it's kind of weird to have a field that
Oren Blasberg
2015/06/01 19:17:32
Done.
| |
| 15 }; | |
| 16 | |
| 17 callback UsersCallback = void (User[] users); | |
| 18 callback UserAddedCallback = void (boolean success); | |
| 19 callback UserRemovedCallback = void (boolean success); | |
| 20 callback IsOwnerCallback = void (boolean isOwner); | |
| 21 callback ManagedCallback = void (boolean managed); | |
| 22 | |
| 23 interface Functions { | |
| 24 // Gets a list of the currently whitelisted users. | |
| 25 static void getWhitelistedUsers(UsersCallback callback); | |
| 26 | |
| 27 // Adds a new user with the given email to the whitelist. | |
| 28 // The callback is called with true if the user was added succesfully, or | |
| 29 // with false if not (e.g. because the user was already present, or the | |
| 30 // current user isn't the owner). | |
| 31 static void addWhitelistedUser(DOMString email, UserAddedCallback callback); | |
| 32 | |
| 33 // Removes the user with the given email from the whitelist. | |
| 34 // The callback is called with true if the user was removed succesfully, or | |
| 35 // with false if not (e.g. because the user was not already present, or | |
| 36 // the current user isn't the owner). | |
| 37 static void removeWhitelistedUser(DOMString email, UserRemovedCallback callb ack); | |
| 38 | |
| 39 // Whether the current user is the owner of the device. | |
| 40 static void isCurrentUserOwner(IsOwnerCallback callback); | |
| 41 | |
| 42 // Whether the whitelist is managed by enterprise. | |
| 43 static void isWhitelistManaged(ManagedCallback callback); | |
| 44 }; | |
| 45 }; | |
| OLD | NEW |