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 3c4ed91064ea7b7116f4a0fa282c15f1362e9d5f..28198a4e792f86e064279f4c0e7e9605a6f8f5f2 100644 |
--- a/chrome/browser/ui/views/omnibox/omnibox_result_view.cc |
+++ b/chrome/browser/ui/views/omnibox/omnibox_result_view.cc |
@@ -355,8 +355,9 @@ void OmniboxResultView::PaintMatch(const AutocompleteMatch& match, |
answer_image_, |
0, 0, answer_image_.width(), answer_image_.height(), |
GetMirroredXInView(x), y, answer_icon_size, answer_icon_size, true); |
+ // See TODO in Layout(). |
x += answer_icon_size + |
- GetThemeProvider()->GetDisplayProperty( |
+ location_bar_view_->GetThemeProvider()->GetDisplayProperty( |
ThemeProperties::PROPERTY_ICON_LABEL_VIEW_TRAILING_PADDING); |
} |
} else { |
@@ -608,7 +609,12 @@ void OmniboxResultView::InitContentsRenderTextIfNecessary() const { |
void OmniboxResultView::Layout() { |
const gfx::ImageSkia icon = GetIcon(); |
- ui::ThemeProvider* theme_provider = GetThemeProvider(); |
+ // TODO(jonross): Currently |location_bar_view_| provides the correct |
+ // ThemeProvider, as it is loaded on the BrowserFrame widget. The root widget |
+ // for OmniboxResultView is AutocompletePopupWidget, which is not loading the |
+ // theme. We should update the omnibox code to also track its own |
+ // ThemeProvider in order to reduce dependancy on LocationBarView. |
+ ui::ThemeProvider* theme_provider = location_bar_view_->GetThemeProvider(); |
// |theme_provider| can be null when animations are running during shutdown, |
// after OmniboxResultView has been removed from the tree of Views. |
if (!theme_provider) |