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

Unified Diff: chrome/browser/ui/views/location_bar/location_bar_view.cc

Issue 1724333002: [MD] Don't allow overflowing location icons to appear on top of toolbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: streamline conditionals, add comments Created 4 years, 10 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 | « chrome/browser/ui/views/dropdown_bar_host.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/location_bar/location_bar_view.cc
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 7adaf3fb21df88758a56c51d7105faf07dcd19cf..a331f1a45973c46fab4e71e5391f5011bab776db 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -179,19 +179,22 @@ void LocationBarView::Init() {
// not prepared for that.
DCHECK(GetWidget());
- if (!ui::MaterialDesignController::IsModeMaterial()) {
- if (is_popup_mode_) {
- const int kOmniboxPopupBorderImages[] =
- IMAGE_GRID(IDR_OMNIBOX_POPUP_BORDER_AND_SHADOW);
- border_painter_.reset(
- views::Painter::CreateImageGridPainter(kOmniboxPopupBorderImages));
- } else {
- ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- const gfx::Insets omnibox_border_insets(14, 9, 14, 9);
- border_painter_.reset(views::Painter::CreateImagePainter(
- *rb.GetImageSkiaNamed(IDR_OMNIBOX_BORDER), omnibox_border_insets));
- }
- }
+ if (ui::MaterialDesignController::IsModeMaterial()) {
+ // Make sure children with layers are clipped. See http://crbug.com/589497
+ SetPaintToLayer(true);
+ SetFillsBoundsOpaquely(false);
+ layer()->SetMasksToBounds(true);
+ } else if (is_popup_mode_) {
+ const int kOmniboxPopupBorderImages[] =
+ IMAGE_GRID(IDR_OMNIBOX_POPUP_BORDER_AND_SHADOW);
+ border_painter_.reset(
+ views::Painter::CreateImageGridPainter(kOmniboxPopupBorderImages));
+ } else {
+ ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
+ const gfx::Insets omnibox_border_insets(14, 9, 14, 9);
+ border_painter_.reset(views::Painter::CreateImagePainter(
+ *rb.GetImageSkiaNamed(IDR_OMNIBOX_BORDER), omnibox_border_insets));
+}
// Determine the main font.
gfx::FontList font_list = ResourceBundle::GetSharedInstance().GetFontList(
« no previous file with comments | « chrome/browser/ui/views/dropdown_bar_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698