| Index: chrome/browser/signin/signin_ui_util.cc
|
| diff --git a/chrome/browser/signin/signin_ui_util.cc b/chrome/browser/signin/signin_ui_util.cc
|
| index 563bef921a6546b8b0d6ba6bd9fb84ee0fb62eba..bab391d20493a3834f06a46b143b7080b1b3cf4b 100644
|
| --- a/chrome/browser/signin/signin_ui_util.cc
|
| +++ b/chrome/browser/signin/signin_ui_util.cc
|
| @@ -28,21 +28,15 @@
|
| #include "ui/gfx/font_list.h"
|
| #include "ui/gfx/text_elider.h"
|
|
|
| +namespace signin_ui_util {
|
| +
|
| namespace {
|
| +
|
| // Maximum width of a username - we trim emails that are wider than this so
|
| // the wrench menu doesn't get ridiculously wide.
|
| const int kUsernameMaxWidth = 200;
|
| -} // namespace
|
| -
|
| -namespace signin_ui_util {
|
| -
|
| -GlobalError* GetSignedInServiceError(Profile* profile) {
|
| - std::vector<GlobalError*> errors = GetSignedInServiceErrors(profile);
|
| - if (errors.empty())
|
| - return NULL;
|
| - return errors[0];
|
| -}
|
|
|
| +// Returns all errors reported by signed in services.
|
| std::vector<GlobalError*> GetSignedInServiceErrors(Profile* profile) {
|
| std::vector<GlobalError*> errors;
|
| // Chrome OS doesn't use SigninGlobalError or SyncGlobalError. Other platforms
|
| @@ -68,6 +62,17 @@ std::vector<GlobalError*> GetSignedInServiceErrors(Profile* profile) {
|
| return errors;
|
| }
|
|
|
| +// If a signed in service is reporting an error, returns the GlobalError
|
| +// object associated with that service, or NULL if no errors are reported.
|
| +GlobalError* GetSignedInServiceError(Profile* profile) {
|
| + std::vector<GlobalError*> errors = GetSignedInServiceErrors(profile);
|
| + if (errors.empty())
|
| + return NULL;
|
| + return errors[0];
|
| +}
|
| +
|
| +} // namespace
|
| +
|
| base::string16 GetSigninMenuLabel(Profile* profile) {
|
| GlobalError* error = signin_ui_util::GetSignedInServiceError(profile);
|
| if (error)
|
|
|