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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_result_view.cc

Issue 15745031: Restyle omnibox popup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove code from toolbar. Created 7 years, 6 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/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 c044521d25ed7e9228a6c0162f6dd21184710d3f..96a189abb52f6ab7a05f75217507b35b8754267e 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc
@@ -106,14 +106,14 @@ class OmniboxResultView::MirroringContext {
OmniboxResultView::OmniboxResultView(
OmniboxResultViewModel* model,
int model_index,
- views::View* location_bar,
+ LocationBarView* location_bar_view,
const gfx::Font& font)
: edge_item_padding_(LocationBarView::GetItemPadding()),
item_padding_(LocationBarView::GetItemPadding()),
minimum_text_vertical_padding_(kMinimumTextVerticalPadding),
model_(model),
model_index_(model_index),
- location_bar_(location_bar),
+ location_bar_view_(location_bar_view),
font_(font),
font_height_(std::max(font.GetHeight(),
font.DeriveFont(0, gfx::BOLD).GetHeight())),
@@ -124,7 +124,7 @@ OmniboxResultView::OmniboxResultView(
CHECK_GE(model_index, 0);
if (default_icon_size_ == 0) {
default_icon_size_ =
- location_bar_->GetThemeProvider()->GetImageSkiaNamed(
+ location_bar_view_->GetThemeProvider()->GetImageSkiaNamed(
AutocompleteMatch::TypeToIcon(
AutocompleteMatchType::URL_WHAT_YOU_TYPED))->width();
}
@@ -221,6 +221,10 @@ OmniboxResultView::ResultViewState OmniboxResultView::GetState() const {
return model_->IsHoveredIndex(model_index_) ? HOVERED : NORMAL;
}
+int OmniboxResultView::GetTextHeight() const {
+ return font_height_;
+}
+
void OmniboxResultView::PaintMatch(gfx::Canvas* canvas,
const AutocompleteMatch& match,
int x) {
@@ -247,10 +251,6 @@ void OmniboxResultView::PaintMatch(gfx::Canvas* canvas,
}
}
-int OmniboxResultView::GetTextHeight() const {
- return font_height_;
-}
-
// static
void OmniboxResultView::CommonInitColors(const ui::NativeTheme* theme,
SkColor colors[][NUM_KINDS]) {
@@ -325,13 +325,13 @@ gfx::ImageSkia OmniboxResultView::GetIcon() const {
break;
}
}
- return *(location_bar_->GetThemeProvider()->GetImageSkiaNamed(icon));
+ return *(location_bar_view_->GetThemeProvider()->GetImageSkiaNamed(icon));
}
const gfx::ImageSkia* OmniboxResultView::GetKeywordIcon() const {
// NOTE: If we ever begin returning icons of varying size, then callers need
// to ensure that |keyword_icon_| is resized each time its image is reset.
- return location_bar_->GetThemeProvider()->GetImageSkiaNamed(
+ return location_bar_view_->GetThemeProvider()->GetImageSkiaNamed(
(GetState() == SELECTED) ? IDR_OMNIBOX_TTS_SELECTED : IDR_OMNIBOX_TTS);
}

Powered by Google App Engine
This is Rietveld 408576698