Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / ash / multi_user / multi_user_util.cc
index 0d9250d..0b99c98 100644 (file)
@@ -6,6 +6,7 @@
 
 #include <vector>
 
+#include "base/strings/string_util.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/profiles/profile_manager.h"
@@ -70,4 +71,21 @@ bool IsProfileFromActiveUser(Profile* profile) {
 #endif
 }
 
+const std::string& GetCurrentUserId() {
+#if defined(OS_CHROMEOS)
+  return chromeos::UserManager::Get()->GetActiveUser()->email();
+#else
+  return base::EmptyString();
+#endif
+}
+
+// Move the window to the current user's desktop.
+void MoveWindowToCurrentDesktop(aura::Window* window) {
+#if defined(OS_CHROMEOS)
+  chrome::MultiUserWindowManager::GetInstance()->ShowWindowForUser(
+      window,
+      GetCurrentUserId());
+#endif
+}
+
 }  // namespace multi_user_util