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

Unified Diff: chrome/browser/ui/views/sad_tab_view.cc

Issue 2794763002: New Sad Tab strings. (Closed)
Patch Set: add bullets Created 3 years, 9 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/views/sad_tab_view.h ('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/sad_tab_view.cc
diff --git a/chrome/browser/ui/views/sad_tab_view.cc b/chrome/browser/ui/views/sad_tab_view.cc
index d101e07ebb94a24a73d444194e5b2550f98a25fc..09f31099a42a3957526e9913d34c9ebe792410dc 100644
--- a/chrome/browser/ui/views/sad_tab_view.cc
+++ b/chrome/browser/ui/views/sad_tab_view.cc
@@ -31,6 +31,7 @@ namespace {
constexpr int kMaxContentWidth = 600;
constexpr int kMinColumnWidth = 120;
constexpr int kTitleBottomSpacing = 13;
+constexpr int kBulletBottomSpacing = 3;
} // namespace
@@ -74,16 +75,38 @@ SadTabView::SadTabView(content::WebContents* web_contents,
const SkColor text_color = GetNativeTheme()->GetSystemColor(
ui::NativeTheme::kColorId_LabelDisabledColor);
- message_ = CreateLabel(l10n_util::GetStringUTF16(GetMessage()));
+ views::Label* message = CreateLabel(l10n_util::GetStringUTF16(GetMessage()));
- message_->SetMultiLine(true);
- message_->SetEnabledColor(text_color);
- message_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
- message_->SetLineHeight(views::kPanelSubVerticalSpacing);
+ message->SetMultiLine(true);
+ message->SetEnabledColor(text_color);
+ message->SetHorizontalAlignment(gfx::ALIGN_LEFT);
+ message->SetLineHeight(views::kPanelSubVerticalSpacing);
layout->StartRowWithPadding(0, column_set_id, 0, kTitleBottomSpacing);
- layout->AddView(message_, 2, 1, views::GridLayout::LEADING,
+ layout->AddView(message, 2, 1, views::GridLayout::LEADING,
views::GridLayout::LEADING);
+ messages_.push_back(message);
+ size_t bullet = 0;
+ int bullet_string_id = GetBulletText(bullet);
+
+ while (bullet_string_id) {
+ // TODO(wfh) add bullet here.
+ base::string16 bullet_string = l10n_util::GetStringUTF16(bullet_string_id);
+ bullet_string = L" \u2022 " + bullet_string;
Will Harris 2017/04/03 19:49:19 I don't know how to do indents here.
kylix_rd 2017/04/04 20:59:07 Did you try setting the indent padding in layout->
Will Harris 2017/04/05 20:01:06 which parameter is the indent padding? I saw only
kylix_rd 2017/04/07 15:47:23 Ah, ok. I thought there was an option for indentin
+ message = CreateLabel(bullet_string);
Will Harris 2017/04/03 19:49:19 I'm assuming something owns and frees the memory t
kylix_rd 2017/04/04 20:59:07 The view is "owned" by the SadTabView instance by
Will Harris 2017/04/05 20:01:06 "its" refers to the layout? I think the call to S
kylix_rd 2017/04/07 15:47:23 The layout manager will add the view to the view o
+
+ message->SetMultiLine(true);
+ message->SetEnabledColor(text_color);
+ message->SetHorizontalAlignment(gfx::ALIGN_LEFT);
+ message->SetLineHeight(views::kPanelSubVerticalSpacing);
+
+ layout->StartRowWithPadding(0, column_set_id, 0, kBulletBottomSpacing);
+ layout->AddView(message, 2, 1, views::GridLayout::LEADING,
+ views::GridLayout::LEADING);
+ messages_.push_back(message);
+ bullet++;
+ bullet_string_id = GetBulletText(bullet);
+ }
action_button_ = views::MdTextButton::CreateSecondaryUiBlueButton(
this, l10n_util::GetStringUTF16(GetButtonTitle()));
@@ -137,7 +160,9 @@ void SadTabView::Layout() {
// Specify the maximum message width explicitly.
const int max_width =
std::min(width() - views::kPanelSubVerticalSpacing * 2, kMaxContentWidth);
- message_->SizeToFit(max_width);
+ for (auto* message : messages_) {
+ message->SizeToFit(max_width);
+ }
title_->SizeToFit(max_width);
View::Layout();
« no previous file with comments | « chrome/browser/ui/views/sad_tab_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698