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

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: Move the IDS_ONE_CLICK_SIGNIN_BUBBLE_MESSAGE string into generated_resources.grd instead of having … Created 7 years 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 6c2a1cc1b1e66513839d4023100a7a09c5a29f37..c7b6fad0683585e94f154c08b0b4b1e661a46f4c 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,9 +28,13 @@
#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;
noms (inactive) 2014/01/06 22:22:23 What's the difference between kMinBubbleWidth and
Oren Blasberg 2014/01/07 00:12:20 The bubble and dialog modes of the view aren't nec
Oren Blasberg 2014/01/08 21:44:00 As discussed offline I've moved the layout->set_mi
const int kMinimumLabelWidth = 240;
+const int kBubbleMargin = 20;
noms (inactive) 2014/01/06 22:22:23 You don't need to redefine this, you can just use
Oren Blasberg 2014/01/07 00:12:20 Done.
const int kDialogMargin = 16;
namespace {
@@ -115,9 +119,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 : kBubbleMargin;
+ set_margins(gfx::Insets(margin, margin, margin, margin));
}
OneClickSigninBubbleView::~OneClickSigninBubbleView() {
@@ -136,6 +140,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 +155,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 +175,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 +204,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,14 +286,14 @@ 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);
@@ -282,7 +304,6 @@ void OneClickSigninBubbleView::GetButtons(views::LabelButton** ok_button,
(*undo_button)->SetText(ok_label);
(*undo_button)->SetText(undo_label);
} else {
- ok_label = l10n_util::GetStringUTF16(IDS_OK);
(*ok_button)->SetText(ok_label);
noms (inactive) 2014/01/06 22:22:23 You can move this (and above) to right under the o
Oren Blasberg 2014/01/07 00:12:20 Ah. Duh. Thanks. :)
Oren Blasberg 2014/01/07 00:12:20 Done.
}
}
« 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