Index: chrome/browser/ui/views/omnibox/omnibox_result_view.cc |
diff --git a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc |
index 85d9f3fb10e1f26eff5292fabbdda9c8e6348cd6..fc47ce70366a1c11cf049de677d52446dbb677d9 100644 |
--- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc |
+++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc |
@@ -471,9 +471,8 @@ int OmniboxResultView::DrawString( |
const gfx::Size size = (*j)->GetStringSize(); |
// Align the text runs to a common baseline. |
const gfx::Rect rect( |
- mirroring_context_->mirrored_left_coord(x, x + size.width()), |
- y + font_list_.GetBaseline() - (*j)->GetBaseline(), |
- size.width(), size.height()); |
+ mirroring_context_->mirrored_left_coord(x, x + size.width()), y, |
+ size.width(), height()); |
(*j)->SetDisplayRect(rect); |
(*j)->Draw(canvas); |
x += size.width(); |
@@ -574,7 +573,6 @@ void OmniboxResultView::Layout() { |
(height() - icon.height()) / 2, icon.width(), icon.height()); |
int text_x = edge_item_padding_ + default_icon_size_ + item_padding_; |
- int text_height = GetTextHeight(); |
int text_width; |
msw
2013/10/23 01:18:00
nit: please explicitly initialize this to 0.
Yuki
2013/10/24 14:32:54
I think it's better not to initialize this to 0.
Peter Kasting
2013/10/24 20:12:05
What about initializing it to (width() - text_x -
Yuki
2013/10/25 15:21:09
Done.
|
if (match_.associated_keyword.get()) { |
@@ -586,16 +584,16 @@ void OmniboxResultView::Layout() { |
const int kw_text_x = kw_x + keyword_icon_->width() + item_padding_; |
text_width = kw_x - text_x - item_padding_; |
- keyword_text_bounds_.SetRect(kw_text_x, 0, |
- std::max(width() - kw_text_x - edge_item_padding_, 0), text_height); |
- keyword_icon_->SetPosition(gfx::Point(kw_x, |
- (height() - keyword_icon_->height()) / 2)); |
+ keyword_text_bounds_.SetRect( |
+ kw_text_x, 0, |
+ std::max(width() - kw_text_x - edge_item_padding_, 0), height()); |
+ keyword_icon_->SetPosition( |
+ gfx::Point(kw_x, (height() - keyword_icon_->height()) / 2)); |
} else { |
text_width = width() - text_x - edge_item_padding_; |
} |
- text_bounds_.SetRect(text_x, std::max(0, (height() - text_height) / 2), |
- std::max(text_width, 0), text_height); |
+ text_bounds_.SetRect(text_x, 0, std::max(text_width, 0), height()); |
} |
void OmniboxResultView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |