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

Unified Diff: chrome/browser/ui/views/infobars/infobar_view.cc

Issue 8221027: Make views::Label and views::Link auto-color themselves to be readable over their background colo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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/infobars/infobar_view.h ('k') | chrome/browser/ui/views/infobars/link_infobar.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/infobars/infobar_view.cc
===================================================================
--- chrome/browser/ui/views/infobars/infobar_view.cc (revision 104959)
+++ chrome/browser/ui/views/infobars/infobar_view.cc (working copy)
@@ -76,26 +76,24 @@
DCHECK(!menu_runner_.get());
}
-// static
-views::Label* InfoBarView::CreateLabel(const string16& text) {
+views::Label* InfoBarView::CreateLabel(const string16& text) const {
views::Label* label = new views::Label(text,
ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont));
- label->SetColor(SK_ColorBLACK);
+ label->SetBackgroundColor(background()->get_color());
+ label->SetEnabledColor(SK_ColorBLACK);
label->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
return label;
}
-// static
views::Link* InfoBarView::CreateLink(const string16& text,
- views::LinkListener* listener,
- const SkColor& background_color) {
+ views::LinkListener* listener) const {
views::Link* link = new views::Link;
link->SetText(text);
link->SetFont(
ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont));
link->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
link->set_listener(listener);
- link->MakeReadableOverBackgroundColor(background_color);
+ link->SetBackgroundColor(background()->get_color());
return link;
}
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_view.h ('k') | chrome/browser/ui/views/infobars/link_infobar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698