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 #include "chrome/browser/signin/signin_ui_util.h" | 5 #include "chrome/browser/signin/signin_ui_util.h" |
6 | 6 |
7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/signin/signin_global_error.h" | 10 #include "chrome/browser/signin/signin_global_error.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
47 } | 47 } |
48 return NULL; | 48 return NULL; |
49 } | 49 } |
50 | 50 |
51 string16 GetSigninMenuLabel(Profile* profile) { | 51 string16 GetSigninMenuLabel(Profile* profile) { |
52 GlobalError* error = signin_ui_util::GetSignedInServiceError(profile); | 52 GlobalError* error = signin_ui_util::GetSignedInServiceError(profile); |
53 if (error) | 53 if (error) |
54 return error->MenuItemLabel(); | 54 return error->MenuItemLabel(); |
55 | 55 |
56 // No errors, so just display the signed in user, if any. | 56 // No errors, so just display the signed in user, if any. |
57 ProfileSyncService* service = profile->IsSyncAccessible() ? | 57 ProfileSyncService* service = |
58 ProfileSyncServiceFactory::GetForProfile(profile) : NULL; | 58 profile->IsSyncAccessible() ? |
Andrew T Wilson (Slow)
2013/02/07 10:08:11
This formatting change is fine, but you might want
Adrian Kuegel
2013/02/07 11:09:21
I should have checked that I reformat it the same
| |
59 ProfileSyncServiceFactory::GetForProfile(profile) : NULL; | |
59 | 60 |
60 // Even if the user is signed in, don't display the "signed in as..." | 61 // Even if the user is signed in, don't display the "signed in as..." |
61 // label if we're still setting up sync. | 62 // label if we're still setting up sync. |
62 if (!service || !service->FirstSetupInProgress()) { | 63 if (!service || !service->FirstSetupInProgress()) { |
63 std::string username; | 64 std::string username; |
64 SigninManager* signin_manager = | 65 SigninManager* signin_manager = |
65 SigninManagerFactory::GetForProfileIfExists(profile); | 66 SigninManagerFactory::GetForProfileIfExists(profile); |
66 if (signin_manager) | 67 if (signin_manager) |
67 username = signin_manager->GetAuthenticatedUsername(); | 68 username = signin_manager->GetAuthenticatedUsername(); |
68 if (!username.empty() && !signin_manager->AuthInProgress()) { | 69 if (!username.empty() && !signin_manager->AuthInProgress()) { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
127 if (status_label) { | 128 if (status_label) { |
128 status_label->assign(l10n_util::GetStringUTF16( | 129 status_label->assign(l10n_util::GetStringUTF16( |
129 IDS_SYNC_ERROR_SIGNING_IN)); | 130 IDS_SYNC_ERROR_SIGNING_IN)); |
130 } | 131 } |
131 break; | 132 break; |
132 } | 133 } |
133 } | 134 } |
134 | 135 |
135 | 136 |
136 } // namespace signin_ui_util | 137 } // namespace signin_ui_util |
OLD | NEW |