Chromium Code Reviews| Index: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc |
| diff --git a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc |
| index b2c8d9443454123b70d159e98a47b36c31dc16ae..dfc47bde45cb7c4c1dafce65a752c23eb3187151 100644 |
| --- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc |
| +++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc |
| @@ -69,6 +69,7 @@ OmniboxPopupContentsView::OmniboxPopupContentsView( |
| set_owned_by_client(); |
| ui::ThemeProvider* theme = location_bar_view_->GetThemeProvider(); |
| + top_shadow_ = theme->GetImageSkiaNamed(IDR_OMNIBOX_DROPDOWN_SHADOW_TOP); |
| int bottom_shadow_asset = ui::MaterialDesignController::IsModeMaterial() ? |
| IDR_OMNIBOX_DROPDOWN_SHADOW_BOTTOM : IDR_BUBBLE_B; |
| bottom_shadow_ = theme->GetImageSkiaNamed(bottom_shadow_asset); |
| @@ -194,10 +195,18 @@ void OmniboxPopupContentsView::UpdatePopupAppearance() { |
| for (size_t i = result_size; i < AutocompleteResult::kMaxMatches; ++i) |
| child_at(i)->SetVisible(false); |
| + // The additional overlap is needed for material design so that the content |
| + // separator beneath the toolbar is not visible underneath the transparent |
| + // shadow asset. |
|
Peter Kasting
2015/08/29 01:00:23
OK, so if we move the comment in the other file ou
tdanderson
2015/08/31 15:23:19
Done.
|
| + int top_edge_overlap = views::NonClientFrameView::kClientEdgeThickness; |
| + if (ui::MaterialDesignController::IsModeMaterial()) |
|
Peter Kasting
2015/08/29 01:00:23
...Then above this line, I'd add a further comment
tdanderson
2015/08/31 15:23:19
Done.
|
| + top_edge_overlap += top_shadow_->height(); |
| + |
| gfx::Point top_left_screen_coord; |
| int width; |
| location_bar_view_->GetOmniboxPopupPositioningInfo( |
| - &top_left_screen_coord, &width, &start_margin_, &end_margin_); |
| + &top_left_screen_coord, &width, &start_margin_, |
| + &end_margin_, top_edge_overlap); |
| gfx::Rect new_target_bounds(top_left_screen_coord, |
| gfx::Size(width, CalculatePopupHeight())); |
| @@ -431,10 +440,15 @@ const char* OmniboxPopupContentsView::GetClassName() const { |
| void OmniboxPopupContentsView::OnPaint(gfx::Canvas* canvas) { |
| // Top border. |
| - canvas->FillRect( |
| - gfx::Rect(0, 0, width(), views::NonClientFrameView::kClientEdgeThickness), |
| - ThemeProperties::GetDefaultColor( |
| - ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
| + if (ui::MaterialDesignController::IsModeMaterial()) { |
| + canvas->TileImageInt(*top_shadow_, 0, 0, width(), top_shadow_->height()); |
| + } else { |
| + canvas->FillRect( |
| + gfx::Rect(0, 0, width(), |
| + views::NonClientFrameView::kClientEdgeThickness), |
| + ThemeProperties::GetDefaultColor( |
| + ThemeProperties::COLOR_TOOLBAR_SEPARATOR)); |
| + } |
| // Bottom border. |
| canvas->TileImageInt(*bottom_shadow_, 0, height() - bottom_shadow_->height(), |