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

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

Issue 2267013002: [MD User Menu] New way to handle supervised user auth error (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added comments Created 4 years, 4 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/views/profiles/profile_chooser_view.h ('k') | 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 c6670a2d0cc05b3d295605f38b4563c4724ef728..8e84590164865ee0aefadc7ff7dc0a3dabd88803 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -1498,6 +1498,9 @@ views::View* ProfileChooserView::CreateSyncErrorViewIfNeeded() {
case sync_ui_util::UNRECOVERABLE_ERROR:
button_out = &sync_error_signin_again_button_;
break;
+ case sync_ui_util::SUPERVISED_USER_AUTH_ERROR:
+ button_out = nullptr;
+ break;
case sync_ui_util::AUTH_ERROR:
button_out = &sync_error_signin_button_;
break;
@@ -1512,13 +1515,7 @@ views::View* ProfileChooserView::CreateSyncErrorViewIfNeeded() {
default:
NOTREACHED();
}
- return CreateSyncErrorView(content_string_id, button_string_id, button_out);
-}
-views::View* ProfileChooserView::CreateSyncErrorView(
- const int content_string_id,
- const int button_string_id,
- views::LabelButton** button_out) {
// Sets an overall horizontal layout.
views::View* view = new views::View();
views::BoxLayout* layout = new views::BoxLayout(
@@ -1557,20 +1554,24 @@ views::View* ProfileChooserView::CreateSyncErrorView(
content_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
vertical_view->AddChildView(content_label);
- // Adds a padding row between error title/content and the button.
- SizedContainer* padding =
- new SizedContainer(gfx::Size(0, views::kRelatedControlVerticalSpacing));
- vertical_view->AddChildView(padding);
-
- // Adds an action button.
- *button_out = views::MdTextButton::CreateSecondaryUiBlueButton(
- this, l10n_util::GetStringUTF16(button_string_id));
- vertical_view->AddChildView(*button_out);
-
- view->AddChildView(vertical_view);
- view->SetBorder(views::Border::CreateEmptyBorder(
+ // Adds an action button if an action exists.
+ if (button_string_id) {
+ // If the button string is specified, then the button itself needs to be
+ // already initialized.
+ DCHECK(button_out);
+ // Adds a padding row between error title/content and the button.
+ SizedContainer* padding =
+ new SizedContainer(gfx::Size(0, views::kRelatedControlVerticalSpacing));
+ vertical_view->AddChildView(padding);
+
+ *button_out = views::MdTextButton::CreateSecondaryUiBlueButton(
+ this, l10n_util::GetStringUTF16(button_string_id));
+ vertical_view->AddChildView(*button_out);
+ view->SetBorder(views::Border::CreateEmptyBorder(
0, 0, views::kRelatedControlSmallVerticalSpacing, 0));
+ }
+ view->AddChildView(vertical_view);
return view;
}
« no previous file with comments | « chrome/browser/ui/views/profiles/profile_chooser_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698