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

Unified Diff: ui/views/bubble/bubble_frame_view.cc

Issue 2955963002: Update Chrome Upstream flow to reflect new UI mocks (Closed)
Patch Set: Code review changes; change label; fix trybot Created 3 years, 6 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
« components/autofill_strings.grdp ('K') | « components/autofill_strings.grdp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_frame_view.cc
diff --git a/ui/views/bubble/bubble_frame_view.cc b/ui/views/bubble/bubble_frame_view.cc
index 2dd002e5a7192c4fa1d47b4089a66f845eb4c08c..378e42726eb9e2f8a45cb4a47201f6058b6096fb 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -132,7 +132,7 @@ Button* BubbleFrameView::CreateCloseButton(ButtonListener* listener) {
gfx::Rect BubbleFrameView::GetBoundsForClientView() const {
gfx::Rect client_bounds = GetContentsBounds();
client_bounds.Inset(GetInsets());
- if (footnote_container_) {
+ if (footnote_container_ && footnote_container_->visible()) {
client_bounds.set_height(client_bounds.height() -
footnote_container_->height());
}
@@ -340,7 +340,7 @@ void BubbleFrameView::Layout() {
bounds.set_width(title_->bounds().right() - bounds.x());
bounds.set_height(title_height);
- if (footnote_container_) {
+ if (footnote_container_ && footnote_container_->visible()) {
const int width = contents_bounds.width();
const int height = footnote_container_->GetHeightForWidth(width);
footnote_container_->SetBounds(
@@ -416,6 +416,7 @@ void BubbleFrameView::SetFootnoteView(View* view) {
footnote_container_->SetBorder(
CreateSolidSidedBorder(1, 0, 0, 0, kFootnoteBorderColor));
footnote_container_->AddChildView(view);
+ footnote_container_->SetVisible(view->visible());
AddChildView(footnote_container_);
}
@@ -541,8 +542,14 @@ gfx::Size BubbleFrameView::GetSizeForClientSize(
size.Enlarge(client_insets.width(), client_insets.height());
size.SetToMax(gfx::Size(title_bar_width, 0));
- if (footnote_container_)
- size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width()));
+ if (footnote_container_) {
+ if (footnote_container_->child_count() >= 1) {
+ footnote_container_->SetVisible(
+ footnote_container_->child_at(0)->visible());
Jared Saul 2017/06/27 21:52:26 Note for msw@/tapted@: This changing of the footno
tapted 2017/06/27 23:36:15 We need something added to bubble_frame_view_unitt
Jared Saul 2017/07/05 19:36:51 1-Unit test) Added a test "FootnoteContainerViewSh
+ }
+ if (footnote_container_->visible())
+ size.Enlarge(0, footnote_container_->GetHeightForWidth(size.width()));
+ }
DialogDelegate* dialog_delegate =
GetWidget()->widget_delegate()->AsDialogDelegate();
« components/autofill_strings.grdp ('K') | « components/autofill_strings.grdp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698