OLD | NEW |
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_PROFILES_PROFILES_STATE_H_ | 5 #ifndef CHROME_BROWSER_PROFILES_PROFILES_STATE_H_ |
6 #define CHROME_BROWSER_PROFILES_PROFILES_STATE_H_ | 6 #define CHROME_BROWSER_PROFILES_PROFILES_STATE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
10 | 10 |
11 class Browser; | 11 class Browser; |
12 class PrefRegistrySimple; | 12 class PrefRegistrySimple; |
13 class Profile; | 13 class Profile; |
14 namespace base { class FilePath; } | 14 namespace base { class FilePath; } |
15 | 15 |
16 namespace profiles { | 16 namespace profiles { |
17 | 17 |
18 // Checks if multiple profiles is enabled. | 18 // Checks if multiple profiles is enabled. |
19 bool IsMultipleProfilesEnabled(); | 19 bool IsMultipleProfilesEnabled(); |
20 | 20 |
21 // Returns the path to the default profile directory, based on the given | 21 // Returns the path to the default profile directory, based on the given |
22 // user data directory. | 22 // user data directory. |
23 base::FilePath GetDefaultProfileDir(const base::FilePath& user_data_dir); | 23 base::FilePath GetDefaultProfileDir(const base::FilePath& user_data_dir); |
24 | 24 |
25 // Register multi-profile related preferences in Local State. | 25 // Register multi-profile related preferences in Local State. |
26 void RegisterPrefs(PrefRegistrySimple* registry); | 26 void RegisterPrefs(PrefRegistrySimple* registry); |
27 | 27 |
28 // Returns the display name of the active on-the-record profile (or guest). | 28 // Returns the display name of the active on-the-record profile (or guest) |
29 base::string16 GetActiveProfileDisplayName(Browser* browser); | 29 // used in the avatar button. If there is only one local profile present, it |
| 30 // will return IDS_SINGLE_PROFILE_DISPLAY_NAME, unless the profile has a |
| 31 // user entered custom name. |
| 32 base::string16 GetAvatarNameForProfile(Profile* profile); |
30 | 33 |
31 // Update the name of |profile| to |new_profile_name|. This updates the | 34 // Update the name of |profile| to |new_profile_name|. This updates the |
32 // profile preferences, which triggers an update in the ProfileInfoCache. | 35 // profile preferences, which triggers an update in the ProfileInfoCache. |
33 void UpdateProfileName(Profile* profile, | 36 void UpdateProfileName(Profile* profile, |
34 const base::string16& new_profile_name); | 37 const base::string16& new_profile_name); |
35 | 38 |
36 // Returns the list of secondary accounts for a specific |profile|, which is | 39 // Returns the list of secondary accounts for a specific |profile|, which is |
37 // all the email addresses associated with the profile that are not equal to | 40 // all the email addresses associated with the profile that are not equal to |
38 // the |primary_account|. | 41 // the |primary_account|. |
39 std::vector<std::string> GetSecondaryAccountsForProfile( | 42 std::vector<std::string> GetSecondaryAccountsForProfile( |
40 Profile* profile, | 43 Profile* profile, |
41 const std::string& primary_account); | 44 const std::string& primary_account); |
42 | 45 |
43 // Returns whether the |browser|'s profile is a non-incognito or guest profile. | 46 // Returns whether the |browser|'s profile is a non-incognito or guest profile. |
44 // The distinction is needed because guest profiles are implemented as | 47 // The distinction is needed because guest profiles are implemented as |
45 // incognito profiles. | 48 // incognito profiles. |
46 bool IsRegularOrGuestSession(Browser* browser); | 49 bool IsRegularOrGuestSession(Browser* browser); |
47 | 50 |
48 } // namespace profiles | 51 } // namespace profiles |
49 | 52 |
50 #endif // CHROME_BROWSER_PROFILES_PROFILES_STATE_H_ | 53 #endif // CHROME_BROWSER_PROFILES_PROFILES_STATE_H_ |
OLD | NEW |