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

Side by Side Diff: chrome/browser/ui/ash/multi_user/multi_user_util.h

Issue 1165323004: We should use UserID object to identify users instead of username. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_UTIL_H_ 5 #ifndef CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_UTIL_H_
6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_UTIL_H_ 6 #define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 class Profile; 10 class Profile;
11 11
12 namespace aura { 12 namespace aura {
13 class Window; 13 class Window;
14 } 14 }
15 15
16 namespace user_manager {
17 class UserID;
18 }
19
16 namespace multi_user_util { 20 namespace multi_user_util {
17 21
18 // Get the user id from a given profile. 22 // Get the user id from a given profile.
19 std::string GetUserIDFromProfile(Profile* profile); 23 user_manager::UserID GetUserIDFromProfile(Profile* profile);
20 24
21 // Get the user id from an email address. 25 // Get the user id from an email address.
22 std::string GetUserIDFromEmail(const std::string& email); 26 user_manager::UserID GetUserIDFromEmail(const std::string& email);
23 27
24 // Get a profile for a given user id. 28 // Get a profile for a given user id.
25 Profile* GetProfileFromUserID(const std::string& user_id); 29 Profile* GetProfileFromUserID(const user_manager::UserID& user_id);
26 30
27 // Get a profile for a |window|. Returns NULL if window belongs to no profile. 31 // Get a profile for a |window|. Returns NULL if window belongs to no profile.
28 Profile* GetProfileFromWindow(aura::Window* window); 32 Profile* GetProfileFromWindow(aura::Window* window);
29 33
30 // Check if the given profile is from the currently active user. Note that since 34 // Check if the given profile is from the currently active user. Note that since
31 // only Chrome OS has the concept of an active user, only Chrome OS can ever 35 // only Chrome OS has the concept of an active user, only Chrome OS can ever
32 // return false. 36 // return false.
33 bool IsProfileFromActiveUser(Profile* profile); 37 bool IsProfileFromActiveUser(Profile* profile);
34 38
35 // Gets the current user. Note that this will only return for ChromeOS a string. 39 // Gets the current user. Note that this will only return for ChromeOS a string.
36 // All other operating systems will get an empty string. 40 // All other operating systems will get an empty string.
37 const std::string& GetCurrentUserId(); 41 const user_manager::UserID& GetCurrentUserId();
38 42
39 // Move the window to the current user's desktop. 43 // Move the window to the current user's desktop.
40 void MoveWindowToCurrentDesktop(aura::Window* window); 44 void MoveWindowToCurrentDesktop(aura::Window* window);
41 45
42 } // namespace multi_user_util 46 } // namespace multi_user_util
43 47
44 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_UTIL_H_ 48 #endif // CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698