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

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

Issue 465313003: Update the new avatar menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits fixed Created 6 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
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 226f64ca169e30a60787644af016bebd4a35763c..7049ed8a3082e8712474cc0529fe24482ae08dde 100644
--- a/chrome/browser/ui/views/profiles/profile_chooser_view.cc
+++ b/chrome/browser/ui/views/profiles/profile_chooser_view.cc
@@ -68,7 +68,7 @@ namespace {
const int kFixedMenuWidth = 250;
const int kButtonHeight = 32;
-const int kFixedGaiaViewHeight = 400;
+const int kFixedGaiaViewHeight = 440;
const int kFixedGaiaViewWidth = 360;
const int kFixedAccountRemovalViewWidth = 280;
const int kFixedSwitchUserViewWidth = 280;
@@ -430,9 +430,11 @@ class TitleCard : public views::View {
private:
virtual void Layout() OVERRIDE{
- back_button_->SetBounds(
- 0, 0, back_button_->GetPreferredSize().width(), height());
- title_label_->SetBoundsRect(GetContentsBounds());
+ int back_button_width = back_button_->GetPreferredSize().width();
+ back_button_->SetBounds(0, 0, back_button_width, height());
+ int label_padding = back_button_width + views::kButtonHEdgeMarginNew;
+ title_label_->SetBounds(
+ label_padding, 0, width() - 2 * label_padding, height());
}
virtual gfx::Size GetPreferredSize() const OVERRIDE{
@@ -914,6 +916,7 @@ views::View* ProfileChooserView::CreateTutorialView(
const base::string16& content_text,
const base::string16& link_text,
const base::string16& button_text,
+ bool stack_button,
views::Link** link,
views::LabelButton** button) {
tutorial_mode_ = tutorial_mode;
@@ -949,25 +952,36 @@ views::View* ProfileChooserView::CreateTutorialView(
layout->AddView(content_label);
// Adds links and buttons.
- views::ColumnSet* button_columns = layout->AddColumnSet(1);
- button_columns->AddColumn(views::GridLayout::LEADING,
- views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0);
- button_columns->AddPaddingColumn(
- 1, views::kUnrelatedControlHorizontalSpacing);
- button_columns->AddColumn(views::GridLayout::TRAILING,
- views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0);
+ *button = new views::LabelButton(this, button_text);
+ (*button)->SetHorizontalAlignment(gfx::ALIGN_CENTER);
+ (*button)->SetStyle(views::Button::STYLE_BUTTON);
+
*link = CreateLink(link_text, this);
(*link)->SetHorizontalAlignment(gfx::ALIGN_LEFT);
(*link)->SetAutoColorReadabilityEnabled(false);
(*link)->SetEnabledColor(SK_ColorWHITE);
- layout->StartRowWithPadding(1, 1, 0, views::kUnrelatedControlVerticalSpacing);
- layout->AddView(*link);
- *button = new views::LabelButton(this, button_text);
- (*button)->SetHorizontalAlignment(gfx::ALIGN_CENTER);
- (*button)->SetStyle(views::Button::STYLE_BUTTON);
- layout->AddView(*button);
+ if (stack_button) {
+ layout->StartRowWithPadding(
+ 1, 0, 0, views::kUnrelatedControlVerticalSpacing);
+ layout->AddView(*button);
+ layout->StartRowWithPadding(1, 0, 0, views::kRelatedControlVerticalSpacing);
+ (*link)->SetHorizontalAlignment(gfx::ALIGN_CENTER);
+ layout->AddView(*link);
+ } else {
+ views::ColumnSet* button_columns = layout->AddColumnSet(1);
+ button_columns->AddColumn(views::GridLayout::LEADING,
+ views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0);
+ button_columns->AddPaddingColumn(
+ 1, views::kUnrelatedControlHorizontalSpacing);
+ button_columns->AddColumn(views::GridLayout::TRAILING,
+ views::GridLayout::CENTER, 0, views::GridLayout::USE_PREF, 0, 0);
+ layout->StartRowWithPadding(
+ 1, 1, 0, views::kUnrelatedControlVerticalSpacing);
+ layout->AddView(*link);
+ layout->AddView(*button);
+ }
return view;
}
@@ -1420,6 +1434,7 @@ views::View* ProfileChooserView::CreateWelcomeUpgradeTutorialViewIfNeeded(
l10n_util::GetStringFUTF16(
IDS_PROFILES_NOT_YOU, avatar_item.name),
l10n_util::GetStringUTF16(IDS_PROFILES_TUTORIAL_WHATS_NEW_BUTTON),
+ true /* stack_button */,
&tutorial_not_you_link_,
&tutorial_see_whats_new_button_);
}
@@ -1432,6 +1447,7 @@ views::View* ProfileChooserView::CreateSigninConfirmationView(){
IDS_PROFILES_CONFIRM_SIGNIN_TUTORIAL_CONTENT_TEXT),
l10n_util::GetStringUTF16(IDS_PROFILES_SYNC_SETTINGS_LINK),
l10n_util::GetStringUTF16(IDS_PROFILES_TUTORIAL_OK_BUTTON),
+ false /* stack_button */,
&tutorial_sync_settings_link_,
&tutorial_sync_settings_ok_button_);
}

Powered by Google App Engine
This is Rietveld 408576698