Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1845)

Unified Diff: chrome/browser/resources/md_user_manager/profile_api.js

Issue 1722843002: MD user manager (html/js/css for create profile flow) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments #3 Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/md_user_manager/profile_api.js
diff --git a/chrome/browser/resources/md_user_manager/profile_api.js b/chrome/browser/resources/md_user_manager/profile_api.js
new file mode 100644
index 0000000000000000000000000000000000000000..a40d70a3c9a6c9c7ca0a464dfe66a4615b0c1645
--- /dev/null
+++ b/chrome/browser/resources/md_user_manager/profile_api.js
@@ -0,0 +1,65 @@
+// Copyright 2016 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.
+
+/** @typedef {{username: string, profilePath: string}} */
+var SignedInUser;
+
+/** @typedef {{name: string, filePath: string, isSupervised: boolean}} */
+var ProfileInfo;
+
+cr.define('signin', function() {
+ /**
+ * API that encapsulates messaging between JS and C++ for creating/importing
+ * profiles in the user-manager page.
+ * @constructor
+ */
+ function ProfileApi() {}
+
+ /**
+ * Called from JavaScript. Gets the available profile icons to choose from.
+ */
+ ProfileApi.getAvailableIcons = function() {
+ chrome.send('requestDefaultProfileIcons');
+ };
+
+ /**
+ * Called from JavaScript. Gets the current signed-in users.
+ */
+ ProfileApi.getSignedInUsers = function() {
+ chrome.send('requestSignedInProfiles');
+ };
+
+ /**
+ * Called from JavaScript. Launches the guest user.
+ */
+ ProfileApi.launchGuestUser = function() {
+ chrome.send('launchGuest');
+ };
+
+ /**
+ * Called from JavaScript. Creates a profile.
+ * @param {string} profileName Name of the new profile.
+ * @param {string} profileIconUrl URL of the selected icon of the new profile.
+ * @param {boolean} isSupervised True if the new profile is supervised.
+ * @param {string|undefined} supervisorProfilePath Profile path of the
+ * supervisor if the new profile is supervised.
+ */
+ ProfileApi.createProfile = function(profileName, profileIconUrl, isSupervised,
+ supervisorProfilePath) {
+ chrome.send('createProfile',
+ [profileName, profileIconUrl, false, isSupervised, '',
+ supervisorProfilePath]);
+ };
+
+ /**
+ * Called from JavaScript. Cancels creation of the new profile.
+ */
+ ProfileApi.cancelCreateProfile = function() {
+ chrome.send('cancelCreateProfile');
+ };
+
+ return {
+ ProfileApi: ProfileApi,
+ };
+});

Powered by Google App Engine
This is Rietveld 408576698