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

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

Issue 2835233005: Revert of Introduce a type of View background that stays in sync with its host (Closed)
Patch Set: Created 3 years, 8 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') | ui/message_center/views/message_bubble_base.h » ('j') | 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 aeaa218893a6848b3db6169c8d8573266c9e9ed4..926d73a73fdcf2ec742a6bb48a4d64a54a7880ce 100644
--- a/chrome/browser/ui/views/sad_tab_view.cc
+++ b/chrome/browser/ui/views/sad_tab_view.cc
@@ -36,8 +36,10 @@
SadTabView::SadTabView(content::WebContents* web_contents,
chrome::SadTabKind kind)
: SadTab(web_contents, kind) {
- set_background(views::Background::CreateThemedSolidBackground(
- this, ui::NativeTheme::kColorId_DialogBackground));
+ // Set the background color.
+ set_background(
+ views::Background::CreateSolidBackground(GetNativeTheme()->GetSystemColor(
+ ui::NativeTheme::kColorId_DialogBackground)));
views::GridLayout* layout = new views::GridLayout(this);
SetLayoutManager(layout);
@@ -59,7 +61,7 @@
layout->StartRow(0, column_set_id);
layout->AddView(image, 2, 1);
- title_ = new views::Label(l10n_util::GetStringUTF16(GetTitle()));
+ title_ = CreateLabel(l10n_util::GetStringUTF16(GetTitle()));
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
title_->SetFontList(rb.GetFontList(ui::ResourceBundle::LargeFont));
title_->SetMultiLine(true);
@@ -68,10 +70,13 @@
views::kPanelVerticalSpacing);
layout->AddView(title_, 2, 1);
- message_ = new views::Label(l10n_util::GetStringUTF16(GetMessage()));
+ const SkColor text_color = GetNativeTheme()->GetSystemColor(
+ ui::NativeTheme::kColorId_LabelDisabledColor);
+
+ message_ = CreateLabel(l10n_util::GetStringUTF16(GetMessage()));
message_->SetMultiLine(true);
- message_->SetEnabled(false);
+ message_->SetEnabledColor(text_color);
message_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
message_->SetLineHeight(views::kPanelSubVerticalSpacing);
@@ -81,8 +86,8 @@
action_button_ = views::MdTextButton::CreateSecondaryUiBlueButton(
this, l10n_util::GetStringUTF16(GetButtonTitle()));
- help_link_ = new views::Link(l10n_util::GetStringUTF16(GetHelpLinkTitle()));
- help_link_->set_listener(this);
+ help_link_ =
+ CreateLink(l10n_util::GetStringUTF16(GetHelpLinkTitle()), text_color);
layout->StartRowWithPadding(0, column_set_id, 0,
views::kPanelVerticalSpacing);
layout->AddView(help_link_, 1, 1, views::GridLayout::LEADING,
@@ -145,6 +150,21 @@
View::OnPaint(canvas);
}
+views::Label* SadTabView::CreateLabel(const base::string16& text) {
+ views::Label* label = new views::Label(text);
+ label->SetBackgroundColor(background()->get_color());
+ return label;
+}
+
+views::Link* SadTabView::CreateLink(const base::string16& text,
+ const SkColor& color) {
+ views::Link* link = new views::Link(text);
+ link->SetBackgroundColor(background()->get_color());
+ link->SetEnabledColor(color);
+ link->set_listener(this);
+ return link;
+}
+
namespace chrome {
SadTab* SadTab::Create(content::WebContents* web_contents,
« no previous file with comments | « chrome/browser/ui/views/sad_tab_view.h ('k') | ui/message_center/views/message_bubble_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698