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

Unified Diff: chrome/browser/ui/views/infobars/infobar_view.h

Issue 1700383002: [MD] Fix clipping of infobar child elements (particularly close button). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: adjust comment 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
Index: chrome/browser/ui/views/infobars/infobar_view.h
diff --git a/chrome/browser/ui/views/infobars/infobar_view.h b/chrome/browser/ui/views/infobars/infobar_view.h
index 919284804a3a0f81e201fc62f8627727d3db02b8..9486766001cd0c1bf628594375076c65f4513cd4 100644
--- a/chrome/browser/ui/views/infobars/infobar_view.h
+++ b/chrome/browser/ui/views/infobars/infobar_view.h
@@ -92,9 +92,9 @@ class InfoBarView : public infobars::InfoBar,
int StartX() const;
int EndX() const;
- // Given a |view|, returns the centered y position within us, taking into
- // account animation so the control "slides in" (or out) as we animate open
- // and closed.
+ // Given a |view|, returns the centered y position within |child_container_|,
+ // taking into account animation so the control "slides in" (or out) as we
+ // animate open and closed.
int OffsetY(views::View* view) const;
// Convenience getter.
@@ -107,6 +107,11 @@ class InfoBarView : public infobars::InfoBar,
views::MenuButton* button,
views::MenuAnchorPosition anchor);
+ protected:
+ // Adds |view| to the content area, i.e. |child_container_|. The |view| won't
+ // automatically get any layout, so should still be laid out manually.
+ void AddViewToContentArea(views::View* view);
+
private:
// Does the actual work for AssignWidths(). Assumes |labels| is sorted by
// decreasing preferred width.
@@ -120,11 +125,14 @@ class InfoBarView : public infobars::InfoBar,
// views::View:
void GetAccessibleState(ui::AXViewState* state) override;
gfx::Size GetPreferredSize() const override;
- void PaintChildren(const ui::PaintContext& context) override;
// views::ExternalFocusTracker:
void OnWillChangeFocus(View* focused_before, View* focused_now) override;
+ // This container holds the children and clips their painting during
+ // animation.
+ views::View* child_container_;
+
// The optional icon at the left edge of the InfoBar.
views::ImageView* icon_;
« no previous file with comments | « chrome/browser/ui/views/infobars/confirm_infobar.cc ('k') | chrome/browser/ui/views/infobars/infobar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698