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

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

Issue 107673002: OneClickSigninBubbleView: Update the bubble form to reflect new bubble/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address noms@ comments. 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 499f52a4118ffa835a7cfb88cdc23c6d2c075050..e3eca98d6b2b4475f299a1c610401daedbddce9c 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
@@ -28,6 +28,9 @@
#include "ui/views/layout/layout_constants.h"
#include "ui/views/widget/widget.h"
+// Minimum width of the the bubble.
+const int kMinBubbleWidth = 310;
+
// Minimum width for the multi-line label.
const int kMinimumDialogLabelWidth = 400;
const int kMinimumLabelWidth = 240;
@@ -115,9 +118,9 @@ OneClickSigninBubbleView::OneClickSigninBubbleView(
set_arrow(views::BubbleBorder::NONE);
set_anchor_view_insets(gfx::Insets(0, 0, anchor_view->height() / 2, 0));
set_close_on_deactivate(false);
- set_margins(gfx::Insets(kDialogMargin, kDialogMargin, kDialogMargin,
- kDialogMargin));
}
+ int margin = is_sync_dialog_ ? kDialogMargin : views::kButtonVEdgeMarginNew;
+ set_margins(gfx::Insets(margin, margin, margin, margin));
}
OneClickSigninBubbleView::~OneClickSigninBubbleView() {
@@ -136,6 +139,7 @@ void OneClickSigninBubbleView::AnimationEnded(const gfx::Animation* animation) {
void OneClickSigninBubbleView::Init() {
views::GridLayout* layout = new views::GridLayout(this);
SetLayoutManager(layout);
+ layout->set_minimum_size(gfx::Size(kMinBubbleWidth, 0));
set_border(views::Border::CreateEmptyBorder(8, 8, 8, 8));
// Column set for descriptive text and link.
@@ -150,7 +154,6 @@ void OneClickSigninBubbleView::Init() {
cs->AddPaddingColumn(1, views::kUnrelatedControlHorizontalSpacing);
cs->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, 0,
views::GridLayout::USE_PREF, 0, 0);
- cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing);
cs->AddColumn(views::GridLayout::TRAILING, views::GridLayout::CENTER, 0,
views::GridLayout::USE_PREF, 0, 0);
@@ -171,6 +174,22 @@ void OneClickSigninBubbleView::Init() {
}
void OneClickSigninBubbleView::InitBubbleContent(views::GridLayout* layout) {
+ // 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);
+
+ views::Label* label = new views::Label(
+ l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_DIALOG_TITLE_NEW));
+ label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
+ label->SetFont(label->font().DeriveFont(3));
+ layout->AddView(label);
+ }
+
+ layout->AddPaddingRow(0, views::kUnrelatedControlLargeVerticalSpacing);
+
// Add main text description.
layout->StartRow(0, COLUMN_SET_FILL_ALIGN);
@@ -184,6 +203,8 @@ void OneClickSigninBubbleView::InitBubbleContent(views::GridLayout* layout) {
label->SizeToFit(kMinimumLabelWidth);
layout->AddView(label);
+ layout->AddPaddingRow(0, views::kUnrelatedControlVerticalSpacing);
+
layout->StartRow(0, COLUMN_SET_CONTROLS);
InitLearnMoreLink();
@@ -264,27 +285,24 @@ void OneClickSigninBubbleView::GetButtons(views::LabelButton** ok_button,
// ignore the minimum default size.,
(*ok_button)->set_min_size(gfx::Size());
- base::string16 ok_label;
+ base::string16 ok_label =
+ l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_DIALOG_OK_BUTTON);
if (is_sync_dialog_) {
*undo_button = new views::LabelButton(this, base::string16());
(*undo_button)->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON);
(*undo_button)->set_min_size(gfx::Size());
- ok_label = l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_DIALOG_OK_BUTTON);
base::string16 undo_label =
l10n_util::GetStringUTF16(IDS_ONE_CLICK_SIGNIN_DIALOG_UNDO_BUTTON);
// To make sure they are the same size, SetText() is called
// with both strings on both buttons.
(*ok_button)->SetText(undo_label);
sky 2014/01/07 21:39:13 Is this needed anymore? And can the text be passed
Oren Blasberg 2014/01/08 21:44:00 Apparently not, since things look fine without it.
- (*ok_button)->SetText(ok_label);
(*undo_button)->SetText(ok_label);
(*undo_button)->SetText(undo_label);
- } else {
- ok_label = l10n_util::GetStringUTF16(IDS_OK);
- (*ok_button)->SetText(ok_label);
}
+ (*ok_button)->SetText(ok_label);
}
void OneClickSigninBubbleView::InitAdvancedLink() {
« 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