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

Unified Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 291843002: [Win,Linux] New avatar menu: Don't show the "Sign in to Chrome" button if sign-in is not allowed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix. Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/profiles/profile_chooser_view.cc
diff --git a/chrome/browser/ui/views/profiles/profile_chooser_view.cc b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
index 5fedd953cc6046e86be0fa3c5d4ad4ad04e28ac3..6a507c6aa366aa3ee05af6f196107b95fbcb4df6 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -981,8 +981,8 @@ views::View* ProfileChooserView::CreateCurrentProfileView(
return view;
// The available links depend on the type of profile that is active.
- layout->StartRow(1, 0);
if (avatar_item.signed_in) {
+ layout->StartRow(1, 0);
if (switches::IsNewProfileManagement()) {
base::string16 link_title = l10n_util::GetStringUTF16(
view_mode_ == BUBBLE_VIEW_MODE_PROFILE_CHOOSER ?
@@ -997,10 +997,16 @@ views::View* ProfileChooserView::CreateCurrentProfileView(
layout->AddView(email_label);
}
} else {
- signin_current_profile_link_ = new views::BlueButton(
- this, l10n_util::GetStringFUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL,
- l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)));
- layout->AddView(signin_current_profile_link_);
+ SigninManagerBase* signin_manager =
+ SigninManagerFactory::GetForProfile(
+ browser_->profile()->GetOriginalProfile());
+ if (signin_manager->IsSigninAllowed()) {
+ signin_current_profile_link_ = new views::BlueButton(
+ this, l10n_util::GetStringFUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL,
+ l10n_util::GetStringUTF16(IDS_SHORT_PRODUCT_NAME)));
+ layout->StartRow(1, 0);
+ layout->AddView(signin_current_profile_link_);
+ }
}
return view;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698