Chromium Code Reviews| 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..3a40a4d1bed57e83b09d194e0e78c86fd6fdb3b2 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) { |
| + 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)); |
| + } else { |
| + *button_out = nullptr; |
|
sky
2016/08/23 13:20:39
The reason I suggested setting *button_to null her
Jane
2016/08/23 15:04:40
Done. I see, thanks!
(I actually realized that set
|
| + } |
| + view->AddChildView(vertical_view); |
| return view; |
| } |