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

Unified Diff: chrome/browser/ui/views/infobars/extension_infobar.cc

Issue 765643003: Remove dependency from infobars component to the embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation Created 6 years 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
Index: chrome/browser/ui/views/infobars/extension_infobar.cc
diff --git a/chrome/browser/ui/views/infobars/extension_infobar.cc b/chrome/browser/ui/views/infobars/extension_infobar.cc
index 92d665be28d5738ea7796c113093c8b2368201bf..60c8a8f9ae219daed5eac14b974a204f0c98f12e 100644
--- a/chrome/browser/ui/views/infobars/extension_infobar.cc
+++ b/chrome/browser/ui/views/infobars/extension_infobar.cc
@@ -96,6 +96,7 @@ ExtensionInfoBar::~ExtensionInfoBar() {
}
void ExtensionInfoBar::Layout() {
+ DCHECK(owner());
InfoBarView::Layout();
infobar_icon_->SetPosition(gfx::Point(StartX(), OffsetY(infobar_icon_)));
@@ -105,10 +106,11 @@ void ExtensionInfoBar::Layout() {
// but the NativeViewHost inside does not seem to be clipped by the ClipRect()
// call in InfoBarView::PaintChildren(), so we have to manually clamp the size
// here.
- extension_view->SetSize(
- gfx::Size(std::max(0, EndX() - StartX() - NonExtensionViewWidth()),
- std::min(height() - kSeparatorLineHeight - arrow_height(),
- GetDelegate()->height())));
+ const infobars::InfoBarConstants& constants = owner()->GetInfoBarConstants();
+ extension_view->SetSize(gfx::Size(
+ std::max(0, EndX() - StartX() - NonExtensionViewWidth()),
+ std::min(height() - constants.separator_line_height - arrow_height(),
+ GetDelegate()->height())));
// We do SetPosition() separately after SetSize() so OffsetY() will work.
extension_view->SetPosition(
gfx::Point(infobar_icon_->bounds().right() + kIconHorizontalMargin,
« no previous file with comments | « chrome/browser/ui/cocoa/infobars/infobar_utilities.mm ('k') | chrome/browser/ui/views/infobars/infobar_background.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698