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

Unified Diff: chrome/browser/ui/views/sync/one_click_signin_bubble_view.cc

Issue 137563002: OneClickSigninBubbleView: Only show title if no error present. [Mac+Views] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update cc file to compile again after a recent change Created 6 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/cocoa/one_click_signin_view_controller.mm ('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/sync/one_click_signin_bubble_view.cc
diff --git a/chrome/browser/ui/views/sync/one_click_signin_bubble_view.cc b/chrome/browser/ui/views/sync/one_click_signin_bubble_view.cc
index 5f017a0ae66c8135ed551634ece46374c42e347e..d9e3ab33f842a913f9f21d97e85bcd1c4f25b129 100644
--- a/chrome/browser/ui/views/sync/one_click_signin_bubble_view.cc
+++ b/chrome/browser/ui/views/sync/one_click_signin_bubble_view.cc
@@ -176,23 +176,25 @@ void OneClickSigninBubbleView::Init() {
void OneClickSigninBubbleView::InitBubbleContent(views::GridLayout* layout) {
layout->set_minimum_size(gfx::Size(kMinBubbleWidth, 0));
- // Add title message.
- views::ColumnSet* cs = layout->AddColumnSet(COLUMN_SET_TITLE_BAR);
- cs->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING, 0,
- views::GridLayout::USE_PREF, 0, 0);
- {
- layout->StartRow(0, COLUMN_SET_TITLE_BAR);
+ // If no error occurred, add title message.
+ if (error_message_.empty()) {
+ views::ColumnSet* cs = layout->AddColumnSet(COLUMN_SET_TITLE_BAR);
+ cs->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING, 0,
+ views::GridLayout::USE_PREF, 0, 0);
+ {
+ layout->StartRow(0, COLUMN_SET_TITLE_BAR);
+
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
+ views::Label* label = new views::Label(
+ l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_DIALOG_TITLE_NEW),
+ rb.GetFontList(ui::ResourceBundle::MediumFont));
+ label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
+ layout->AddView(label);
+ }
- ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- views::Label* label = new views::Label(
- l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_DIALOG_TITLE_NEW),
- rb.GetFontList(ui::ResourceBundle::MediumFont));
- label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
- layout->AddView(label);
+ layout->AddPaddingRow(0, views::kUnrelatedControlLargeVerticalSpacing);
}
- layout->AddPaddingRow(0, views::kUnrelatedControlLargeVerticalSpacing);
-
// Add main text description.
layout->StartRow(0, COLUMN_SET_FILL_ALIGN);
@@ -281,7 +283,8 @@ void OneClickSigninBubbleView::InitButtons(views::GridLayout* layout) {
void OneClickSigninBubbleView::GetButtons(views::LabelButton** ok_button,
views::LabelButton** undo_button) {
- base::string16 ok_label =
+ base::string16 ok_label = !error_message_.empty() ?
+ l10n_util::GetStringUTF16(IDS_OK) :
l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_DIALOG_OK_BUTTON);
*ok_button = new views::LabelButton(this, ok_label);
« no previous file with comments | « chrome/browser/ui/cocoa/one_click_signin_view_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698