OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_SIGNIN_SIGNIN_UI_UTIL_H_ | 5 #ifndef CHROME_BROWSER_SIGNIN_SIGNIN_UI_UTIL_H_ |
6 #define CHROME_BROWSER_SIGNIN_SIGNIN_UI_UTIL_H_ | 6 #define CHROME_BROWSER_SIGNIN_SIGNIN_UI_UTIL_H_ |
7 | 7 |
| 8 #include <string> |
8 #include <vector> | 9 #include <vector> |
9 | 10 |
10 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
11 | 12 |
12 class GlobalError; | 13 class GlobalError; |
13 class Profile; | 14 class Profile; |
14 class SigninManagerBase; | 15 class SigninManagerBase; |
15 | 16 |
16 // Utility functions to gather status information from the various signed in | 17 // Utility functions to gather status information from the various signed in |
17 // services and construct messages suitable for showing in UI. | 18 // services and construct messages suitable for showing in UI. |
18 namespace signin_ui_util { | 19 namespace signin_ui_util { |
19 | 20 |
20 // The maximum number of times to show the welcome tutorial for an upgrade user. | 21 // The maximum number of times to show the welcome tutorial for an upgrade user. |
21 const int kUpgradeWelcomeTutorialShowMax = 1; | 22 const int kUpgradeWelcomeTutorialShowMax = 1; |
22 | 23 |
23 void GetStatusLabelsForAuthError(Profile* profile, | |
24 const SigninManagerBase& signin_manager, | |
25 base::string16* status_label, | |
26 base::string16* link_label); | |
27 | |
28 // Returns the username of the authenticated user or an empty string if there is | 24 // Returns the username of the authenticated user or an empty string if there is |
29 // no authenticated user. | 25 // no authenticated user. |
30 base::string16 GetAuthenticatedUsername(const SigninManagerBase* signin); | 26 base::string16 GetAuthenticatedUsername(const SigninManagerBase* signin); |
31 | 27 |
32 // Initializes signin-related preferences. | 28 // Initializes signin-related preferences. |
33 void InitializePrefsForProfile(Profile* profile); | 29 void InitializePrefsForProfile(Profile* profile); |
34 | 30 |
35 // Shows a learn more page for signin errors. | 31 // Shows a learn more page for signin errors. |
36 void ShowSigninErrorLearnMorePage(Profile* profile); | 32 void ShowSigninErrorLearnMorePage(Profile* profile); |
37 | 33 |
38 // Returns the display email string for the given account. If the profile | 34 // Returns the display email string for the given account. If the profile |
39 // has not been migrated to use gaia ids, then its possible for the display | 35 // has not been migrated to use gaia ids, then its possible for the display |
40 // to not ne known yet. In this case, use |account_id|, which is assumed to | 36 // to not ne known yet. In this case, use |account_id|, which is assumed to |
41 // be an email address. | 37 // be an email address. |
42 std::string GetDisplayEmail(Profile* profile, const std::string& account_id); | 38 std::string GetDisplayEmail(Profile* profile, const std::string& account_id); |
43 | 39 |
44 } // namespace signin_ui_util | 40 } // namespace signin_ui_util |
45 | 41 |
46 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_UI_UTIL_H_ | 42 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_UI_UTIL_H_ |
OLD | NEW |