Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / common / extensions / api / users_private.idl
blobac478738a5512a756fd7d0accb44352c2832f6b5
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.
5 // Use the <code>chrome.usersPrivate</code> API to manage users.
6 [platforms=("chromeos"),
7 implemented_in="chrome/browser/chromeos/extensions/users_private/users_private_api.h"]
8 namespace usersPrivate {
10 dictionary User {
11 // Email for the user.
12 DOMString email;
14 // Whether this user is the device owner.
15 boolean isOwner;
18 callback UsersCallback = void (User[] users);
19 callback UserAddedCallback = void (boolean success);
20 callback UserRemovedCallback = void (boolean success);
21 callback IsOwnerCallback = void (boolean isOwner);
22 callback ManagedCallback = void (boolean managed);
24 interface Functions {
25 // Gets a list of the currently whitelisted users.
26 static void getWhitelistedUsers(UsersCallback callback);
28 // Adds a new user with the given email to the whitelist.
29 // The callback is called with true if the user was added succesfully, or
30 // with false if not (e.g. because the user was already present, or the
31 // current user isn't the owner).
32 static void addWhitelistedUser(DOMString email, UserAddedCallback callback);
34 // Removes the user with the given email from the whitelist.
35 // The callback is called with true if the user was removed succesfully, or
36 // with false if not (e.g. because the user was not already present, or
37 // the current user isn't the owner).
38 static void removeWhitelistedUser(DOMString email, UserRemovedCallback callback);
40 // Whether the current user is the owner of the device.
41 static void isCurrentUserOwner(IsOwnerCallback callback);
43 // Whether the whitelist is managed by enterprise.
44 static void isWhitelistManaged(ManagedCallback callback);