Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Unified Diff: chrome/browser/signin/signin_ui_util.cc

Issue 1289413003: Switch global error menu icon to vectorized MD asset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: kick signin error service on mac Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)

Powered by Google App Engine
This is Rietveld 408576698