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

Side by Side Diff: chrome/browser/ui/views/infobars/infobar_view.cc

Issue 1800373002: [MD] replace infobar bottom solid line separator with a shadow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_container_view.cc ('k') | ui/gfx/skia_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/infobars/infobar_view.h" 5 #include "chrome/browser/ui/views/infobars/infobar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 child_container_(new views::View()), 82 child_container_(new views::View()),
83 icon_(nullptr), 83 icon_(nullptr),
84 close_button_(nullptr) { 84 close_button_(nullptr) {
85 set_owned_by_client(); // InfoBar deletes itself at the appropriate time. 85 set_owned_by_client(); // InfoBar deletes itself at the appropriate time.
86 set_background( 86 set_background(
87 new InfoBarBackground(infobars::InfoBar::delegate()->GetInfoBarType())); 87 new InfoBarBackground(infobars::InfoBar::delegate()->GetInfoBarType()));
88 SetEventTargeter(make_scoped_ptr(new views::ViewTargeter(this))); 88 SetEventTargeter(make_scoped_ptr(new views::ViewTargeter(this)));
89 89
90 AddChildView(child_container_); 90 AddChildView(child_container_);
91 91
92 SetPaintToLayer(true);
93 layer()->SetFillsBoundsOpaquely(false);
94
92 if (ui::MaterialDesignController::IsModeMaterial()) { 95 if (ui::MaterialDesignController::IsModeMaterial()) {
93 SetPaintToLayer(true);
94 layer()->SetFillsBoundsOpaquely(false);
95
96 child_container_->SetPaintToLayer(true); 96 child_container_->SetPaintToLayer(true);
97 child_container_->layer()->SetMasksToBounds(true); 97 child_container_->layer()->SetMasksToBounds(true);
98 // Since MD doesn't use a gradient, we can set a solid bg color. 98 // Since MD doesn't use a gradient, we can set a solid bg color.
99 child_container_->set_background( 99 child_container_->set_background(
100 views::Background::CreateSolidBackground(infobars::InfoBar::GetTopColor( 100 views::Background::CreateSolidBackground(infobars::InfoBar::GetTopColor(
101 infobars::InfoBar::delegate()->GetInfoBarType()))); 101 infobars::InfoBar::delegate()->GetInfoBarType())));
102 } 102 }
103 } 103 }
104 104
105 InfoBarView::~InfoBarView() { 105 InfoBarView::~InfoBarView() {
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after
431 } 431 }
432 432
433 bool InfoBarView::DoesIntersectRect(const View* target, 433 bool InfoBarView::DoesIntersectRect(const View* target,
434 const gfx::Rect& rect) const { 434 const gfx::Rect& rect) const {
435 DCHECK_EQ(this, target); 435 DCHECK_EQ(this, target);
436 // Only events that intersect the portion below the arrow are interesting. 436 // Only events that intersect the portion below the arrow are interesting.
437 gfx::Rect non_arrow_bounds = GetLocalBounds(); 437 gfx::Rect non_arrow_bounds = GetLocalBounds();
438 non_arrow_bounds.Inset(0, arrow_height(), 0, 0); 438 non_arrow_bounds.Inset(0, arrow_height(), 0, 0);
439 return rect.Intersects(non_arrow_bounds); 439 return rect.Intersects(non_arrow_bounds);
440 } 440 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/infobars/infobar_container_view.cc ('k') | ui/gfx/skia_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698