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

Unified Diff: chrome/browser/ui/cocoa/browser_window_controller.mm

Issue 12077030: Allow signin to continue even if sync is disabled by policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows sync integration test failure Created 7 years, 11 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
« no previous file with comments | « chrome/browser/ui/chrome_pages.cc ('k') | chrome/browser/ui/cocoa/browser_window_controller_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/browser_window_controller.mm
diff --git a/chrome/browser/ui/cocoa/browser_window_controller.mm b/chrome/browser/ui/cocoa/browser_window_controller.mm
index 70f82097859fa7590e1bbca2e41b5b1e2c56a981..c40fa1c4ac95323e344196a66ddf4df608b93ead 100644
--- a/chrome/browser/ui/cocoa/browser_window_controller.mm
+++ b/chrome/browser/ui/cocoa/browser_window_controller.mm
@@ -22,12 +22,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_info_cache.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/signin/signin_manager.h"
-#include "chrome/browser/signin/signin_manager_factory.h"
-#include "chrome/browser/sync/profile_sync_service.h"
-#include "chrome/browser/sync/profile_sync_service_factory.h"
-#include "chrome/browser/sync/sync_global_error.h"
-#include "chrome/browser/sync/sync_ui_util.h"
+#include "chrome/browser/signin/signin_ui_util.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/browser.h"
@@ -247,36 +242,8 @@ enum {
}
}
- // Figure out what string to display in the signin menu item - depending on
- // the state of the signed-in services, this will be one of:
- // "Sign in to <product name>"
- // "Signed in as <username>"
- // "Signin Error"
- ProfileSyncService* syncService = profile->IsSyncAccessible() ?
- ProfileSyncServiceFactory::GetInstance()->GetForProfile(
- profile->GetOriginalProfile()) : NULL;
- SigninManager* signin = SigninManagerFactory::GetForProfile(profile);
- std::string userName = signin->GetAuthenticatedUsername();
- NSString* title = NULL;
- if (userName.empty() || signin->AuthInProgress() ||
- (syncService && !syncService->HasSyncSetupCompleted())) {
- // Not signed in yet - display the default string.
- title = GetNSStringFWithFixup(IDS_SYNC_MENU_PRE_SYNCED_LABEL,
- GetStringUTF16(IDS_SHORT_PRODUCT_NAME));
- } else if (signin->signin_global_error()->HasBadge()) {
- // TODO(atwilson): Change this string to a generic signin error instead of
- // a "Sync error" string once we allow signin without sync.
- title = GetNSStringWithFixup(IDS_SYNC_MENU_SYNC_ERROR_LABEL);
- } else if (syncService && syncService->sync_global_error() &&
- syncService->sync_global_error()->HasBadge()) {
- title = GetNSStringWithFixup(IDS_SYNC_MENU_SYNC_ERROR_LABEL);
- } else {
- // Signed in.
- title = GetNSStringFWithFixup(IDS_SYNC_MENU_SYNCED_LABEL,
- UTF8ToUTF16(userName));
- }
-
- [signinMenuItem setTitle:title];
+ string16 label = signin_ui_util::GetSigninMenuLabel(profile);
+ [signinMenuItem setTitle:l10n_util::FixUpWindowsStyleLabel(label)];
[signinMenuItem setHidden:!showSigninMenuItem];
[followingSeparator setHidden:!showSigninMenuItem];
}
@@ -1123,7 +1090,6 @@ enum {
case IDC_SHOW_SIGNIN: {
Profile* original_profile =
browser_->profile()->GetOriginalProfile();
- enable &= original_profile->IsSyncAccessible();
[BrowserWindowController updateSigninItem:item
shouldShow:enable
currentProfile:original_profile];
« no previous file with comments | « chrome/browser/ui/chrome_pages.cc ('k') | chrome/browser/ui/cocoa/browser_window_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698