OLD | NEW |
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 "ui/views/bubble/bubble_frame_view.h" | 5 #include "ui/views/bubble/bubble_frame_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 } | 356 } |
357 | 357 |
358 void BubbleFrameView::OnNativeThemeChanged(const ui::NativeTheme* theme) { | 358 void BubbleFrameView::OnNativeThemeChanged(const ui::NativeTheme* theme) { |
359 if (bubble_border_ && bubble_border_->use_theme_background_color()) { | 359 if (bubble_border_ && bubble_border_->use_theme_background_color()) { |
360 bubble_border_->set_background_color(GetNativeTheme()-> | 360 bubble_border_->set_background_color(GetNativeTheme()-> |
361 GetSystemColor(ui::NativeTheme::kColorId_DialogBackground)); | 361 GetSystemColor(ui::NativeTheme::kColorId_DialogBackground)); |
362 SchedulePaint(); | 362 SchedulePaint(); |
363 } | 363 } |
364 } | 364 } |
365 | 365 |
| 366 void BubbleFrameView::ViewHierarchyChanged( |
| 367 const ViewHierarchyChangedDetails& details) { |
| 368 if (!details.is_add && details.parent == footnote_container_ && |
| 369 footnote_container_->child_count() == 1 && |
| 370 details.child == footnote_container_->child_at(0)) { |
| 371 // Setting the footnote_container_ to be hidden and null it. This will |
| 372 // remove update the bubble to have no placeholder for the footnote and |
| 373 // enable the destructor to delete the footnote_container_ later. |
| 374 footnote_container_->SetVisible(false); |
| 375 footnote_container_ = nullptr; |
| 376 } |
| 377 } |
| 378 |
366 void BubbleFrameView::OnPaint(gfx::Canvas* canvas) { | 379 void BubbleFrameView::OnPaint(gfx::Canvas* canvas) { |
367 OnPaintBackground(canvas); | 380 OnPaintBackground(canvas); |
368 // Border comes after children. | 381 // Border comes after children. |
369 } | 382 } |
370 | 383 |
371 void BubbleFrameView::PaintChildren(const ui::PaintContext& context) { | 384 void BubbleFrameView::PaintChildren(const ui::PaintContext& context) { |
372 NonClientFrameView::PaintChildren(context); | 385 NonClientFrameView::PaintChildren(context); |
373 | 386 |
374 ui::PaintCache paint_cache; | 387 ui::PaintCache paint_cache; |
375 ui::PaintRecorder recorder(context, size(), &paint_cache); | 388 ui::PaintRecorder recorder(context, size(), &paint_cache); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 | 548 |
536 DialogDelegate* dialog_delegate = | 549 DialogDelegate* dialog_delegate = |
537 GetWidget()->widget_delegate()->AsDialogDelegate(); | 550 GetWidget()->widget_delegate()->AsDialogDelegate(); |
538 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth()) | 551 if (dialog_delegate && dialog_delegate->ShouldSnapFrameWidth()) |
539 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width())); | 552 size.set_width(LayoutProvider::Get()->GetSnappedDialogWidth(size.width())); |
540 | 553 |
541 return size; | 554 return size; |
542 } | 555 } |
543 | 556 |
544 } // namespace views | 557 } // namespace views |
OLD | NEW |