| 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 <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 | 11 |
| 12 class GlobalError; | 12 class GlobalError; |
| 13 class Profile; | 13 class Profile; |
| 14 class SigninManagerBase; | 14 class SigninManagerBase; |
| 15 | 15 |
| 16 // Utility functions to gather status information from the various signed in | 16 // Utility functions to gather status information from the various signed in |
| 17 // services and construct messages suitable for showing in UI. | 17 // services and construct messages suitable for showing in UI. |
| 18 namespace signin_ui_util { | 18 namespace signin_ui_util { |
| 19 | 19 |
| 20 // 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. |
| 21 const int kUpgradeWelcomeTutorialShowMax = 1; | 21 const int kUpgradeWelcomeTutorialShowMax = 1; |
| 22 | 22 |
| 23 // If a signed in service is reporting an error, returns the GlobalError | |
| 24 // object associated with that service, or NULL if no errors are reported. | |
| 25 GlobalError* GetSignedInServiceError(Profile* profile); | |
| 26 | |
| 27 // Returns all errors reported by signed in services. | |
| 28 std::vector<GlobalError*> GetSignedInServiceErrors(Profile* profile); | |
| 29 | |
| 30 // Returns the label that should be displayed in the signin menu (i.e. | 23 // Returns the label that should be displayed in the signin menu (i.e. |
| 31 // "Sign in to Chromium", "Signin Error...", etc). | 24 // "Sign in to Chromium", "Signin Error...", etc). |
| 32 base::string16 GetSigninMenuLabel(Profile* profile); | 25 base::string16 GetSigninMenuLabel(Profile* profile); |
| 33 | 26 |
| 34 void GetStatusLabelsForAuthError(Profile* profile, | 27 void GetStatusLabelsForAuthError(Profile* profile, |
| 35 const SigninManagerBase& signin_manager, | 28 const SigninManagerBase& signin_manager, |
| 36 base::string16* status_label, | 29 base::string16* status_label, |
| 37 base::string16* link_label); | 30 base::string16* link_label); |
| 38 | 31 |
| 39 // Initializes signin-related preferences. | 32 // Initializes signin-related preferences. |
| 40 void InitializePrefsForProfile(Profile* profile); | 33 void InitializePrefsForProfile(Profile* profile); |
| 41 | 34 |
| 42 // Shows a learn more page for signin errors. | 35 // Shows a learn more page for signin errors. |
| 43 void ShowSigninErrorLearnMorePage(Profile* profile); | 36 void ShowSigninErrorLearnMorePage(Profile* profile); |
| 44 | 37 |
| 45 // Returns the display email string for the given account. If the profile | 38 // Returns the display email string for the given account. If the profile |
| 46 // has not been migrated to use gaia ids, then its possible for the display | 39 // has not been migrated to use gaia ids, then its possible for the display |
| 47 // to not ne known yet. In this case, use |account_id|, which is assumed to | 40 // to not ne known yet. In this case, use |account_id|, which is assumed to |
| 48 // be an email address. | 41 // be an email address. |
| 49 std::string GetDisplayEmail(Profile* profile, const std::string& account_id); | 42 std::string GetDisplayEmail(Profile* profile, const std::string& account_id); |
| 50 | 43 |
| 51 } // namespace signin_ui_util | 44 } // namespace signin_ui_util |
| 52 | 45 |
| 53 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_UI_UTIL_H_ | 46 #endif // CHROME_BROWSER_SIGNIN_SIGNIN_UI_UTIL_H_ |
| OLD | NEW |