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

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

Issue 1262413005: Fix Spacing in OmniboxResultView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698