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