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

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

Issue 2794763002: New Sad Tab strings. (Closed)
Patch Set: right number of spaces as per UI review Created 3 years, 7 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/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 aeaa218893a6848b3db6169c8d8573266c9e9ed4..3ecb60fa2cb4b91f3c7668873bad7336e5750c46 100644
--- a/chrome/browser/ui/views/sad_tab_view.cc
+++ b/chrome/browser/ui/views/sad_tab_view.cc
@@ -30,6 +30,7 @@ namespace {
constexpr int kMaxContentWidth = 600;
constexpr int kMinColumnWidth = 120;
constexpr int kTitleBottomSpacing = 13;
+constexpr int kBulletBottomSpacing = 3;
} // namespace
@@ -68,16 +69,39 @@ SadTabView::SadTabView(content::WebContents* web_contents,
views::kPanelVerticalSpacing);
layout->AddView(title_, 2, 1);
- message_ = new views::Label(l10n_util::GetStringUTF16(GetMessage()));
+ views::Label* message =
+ new views::Label(l10n_util::GetStringUTF16(GetMessage()));
- message_->SetMultiLine(true);
- message_->SetEnabled(false);
- message_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
- message_->SetLineHeight(views::kPanelSubVerticalSpacing);
+ message->SetMultiLine(true);
+ message->SetEnabled(false);
+ 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.
sky 2017/05/14 13:46:16 Optional: generally chrome code has a ':' after th
Will Harris 2017/05/17 18:25:19 I'm not even sure what the TODO means, I think thi
+ base::string16 bullet_string = l10n_util::GetStringUTF16(bullet_string_id);
+ bullet_string = L" \u2022 " + bullet_string;
+ message = new views::Label(bullet_string);
sky 2017/05/14 13:46:16 The way you have this now, if a line wraps the tex
Will Harris 2017/05/17 18:25:19 hmm I found however I resized the window I was not
sky 2017/05/17 19:11:41 I would rather see you do it correctly than kick t
+
+ message->SetMultiLine(true);
+ message->SetEnabled(false);
+ 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()));
@@ -131,7 +155,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_) {
sky 2017/05/14 13:46:16 no {}. optional: auto* -> view::Label* for clarity
Will Harris 2017/05/17 18:25:19 Done.
+ message->SizeToFit(max_width);
+ }
title_->SizeToFit(max_width);
View::Layout();
« chrome/browser/ui/views/sad_tab_view.h ('K') | « 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