From 9bda657b24ae0b7db9f92cfe2650f757e3f13896 Mon Sep 17 00:00:00 2001 From: tdanderson Date: Tue, 18 Aug 2015 06:39:13 -0700 Subject: [PATCH] Change omnibox dropdown bottom shadow for material design Use a different asset for the shadow along the bottom edge of the omnibox dropdown in the material design implementation. BUG=520679 TEST=manual R=pkasting TBR=pkotwicz Review URL: https://codereview.chromium.org/1299693002 Cr-Commit-Position: refs/heads/master@{#343903} --- chrome/browser/themes/theme_properties.cc | 2 +- chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/chrome/browser/themes/theme_properties.cc b/chrome/browser/themes/theme_properties.cc index 66e8d57dcbb5..b3c5fdf45646 100644 --- a/chrome/browser/themes/theme_properties.cc +++ b/chrome/browser/themes/theme_properties.cc @@ -126,7 +126,7 @@ const int kLocationBarVerticalPadding[] = {2, 6, 6}; // The number of pixels in the omnibox dropdown border image interior to // the actual border. -const int kOmniboxDropdownBorderInterior[] = {6, 6, 6}; +const int kOmniboxDropdownBorderInterior[] = {6, 0, 0}; // In an omnibox dropdown row, the minimum distance between the top and // bottom of the row's icon and the top or bottom of the row edge. 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 11e4fe522281..d716b57767e8 100644 --- a/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc +++ b/chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc @@ -11,6 +11,8 @@ #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/omnibox/omnibox_result_view.h" #include "components/omnibox/browser/omnibox_view.h" +#include "grit/theme_resources.h" +#include "ui/base/resource/material_design/material_design_controller.h" #include "ui/base/theme_provider.h" #include "ui/compositor/clip_transform_recorder.h" #include "ui/compositor/paint_recorder.h" @@ -67,7 +69,9 @@ OmniboxPopupContentsView::OmniboxPopupContentsView( set_owned_by_client(); ui::ThemeProvider* theme = location_bar_view_->GetThemeProvider(); - bottom_shadow_ = theme->GetImageSkiaNamed(IDR_BUBBLE_B); + int bottom_shadow_asset = ui::MaterialDesignController::IsModeMaterial() ? + IDR_OMNIBOX_DROPDOWN_SHADOW_BOTTOM : IDR_BUBBLE_B; + bottom_shadow_ = theme->GetImageSkiaNamed(bottom_shadow_asset); SetEventTargeter( scoped_ptr(new views::ViewTargeter(this))); -- 2.11.4.GIT