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

Unified Diff: chrome/browser/ui/views/location_bar/keyword_hint_view.cc

Issue 25039002: Always aligns text at vertically center (Textfield, Label). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced. Created 7 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
Index: chrome/browser/ui/views/location_bar/keyword_hint_view.cc
diff --git a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
index c2e310660465fffc4b3fb36c46e00af66e07733e..a421043b922aeadb38f377a57fcc1d4f3dac13ea 100644
--- a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
+++ b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
@@ -24,19 +24,18 @@
KeywordHintView::KeywordHintView(Profile* profile,
const gfx::FontList& font_list,
- int font_y_offset,
SkColor text_color,
SkColor background_color)
: profile_(profile),
tab_image_(new views::ImageView()) {
leading_label_ =
- CreateLabel(font_list, font_y_offset, text_color, background_color);
+ CreateLabel(font_list, text_color, background_color);
tab_image_->SetImage(
ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
IDR_OMNIBOX_KEYWORD_HINT_TAB));
AddChildView(tab_image_);
trailing_label_ =
- CreateLabel(font_list, font_y_offset, text_color, background_color);
+ CreateLabel(font_list, text_color, background_color);
}
KeywordHintView::~KeywordHintView() {
@@ -84,21 +83,19 @@ void KeywordHintView::Layout() {
bool show_labels = (width() != tab_width);
gfx::Size leading_size(leading_label_->GetPreferredSize());
leading_label_->SetBounds(0, 0, show_labels ? leading_size.width() : 0,
- leading_size.height());
+ height());
tab_image_->SetBounds(leading_label_->bounds().right(), 0, tab_width,
height());
gfx::Size trailing_size(trailing_label_->GetPreferredSize());
trailing_label_->SetBounds(tab_image_->bounds().right(), 0,
show_labels ? trailing_size.width() : 0,
- trailing_size.height());
+ height());
}
views::Label* KeywordHintView::CreateLabel(const gfx::FontList& font_list,
- int font_y_offset,
SkColor text_color,
SkColor background_color) {
views::Label* label = new views::Label(string16(), font_list);
- label->set_border(views::Border::CreateEmptyBorder(font_y_offset, 0, 0, 0));
label->SetEnabledColor(text_color);
label->SetBackgroundColor(background_color);
AddChildView(label);
« no previous file with comments | « chrome/browser/ui/views/location_bar/keyword_hint_view.h ('k') | chrome/browser/ui/views/location_bar/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698