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

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

Issue 1717453003: Introduce BubbleDialogDelegateView, which extends DialogDelegateView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: relative ps 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: 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 c1028355467e7bc42c722837fc75acdd874f33bc..cc99ede8ad9122ef26be0157f1b6edb7346b807a 100644
--- a/ui/views/bubble/bubble_frame_view.cc
+++ b/ui/views/bubble/bubble_frame_view.cc
@@ -77,7 +77,6 @@ BubbleFrameView::BubbleFrameView(const gfx::Insets& title_margins,
title_icon_(new views::ImageView()),
title_(nullptr),
close_(nullptr),
- titlebar_extra_view_(nullptr),
footnote_container_(nullptr),
close_button_clicked_(false) {
AddChildView(title_icon_);
@@ -307,19 +306,6 @@ void BubbleFrameView::Layout() {
title_icon_size.width() + title_label_size.width() + padding);
bounds.set_height(title_height);
- if (titlebar_extra_view_) {
- const int extra_width = close_->x() - bounds.right();
- gfx::Size size = titlebar_extra_view_->GetPreferredSize();
- size.SetToMin(gfx::Size(std::max(0, extra_width), size.height()));
- gfx::Rect titlebar_extra_view_bounds(
- close_->x() - size.width(),
- bounds.y(),
- size.width(),
- bounds.height());
- titlebar_extra_view_bounds.Subtract(bounds);
- titlebar_extra_view_->SetBoundsRect(titlebar_extra_view_bounds);
- }
-
if (footnote_container_) {
gfx::Rect local_bounds = GetContentsBounds();
int height = footnote_container_->GetHeightForWidth(local_bounds.width());
@@ -333,11 +319,6 @@ const char* BubbleFrameView::GetClassName() const {
return kViewClassName;
}
-void BubbleFrameView::ChildPreferredSizeChanged(View* child) {
- if (child == titlebar_extra_view_ || child == title_)
- Layout();
-}
-
void BubbleFrameView::OnThemeChanged() {
UpdateWindowTitle();
ResetWindowControls();
@@ -367,21 +348,11 @@ void BubbleFrameView::SetBubbleBorder(scoped_ptr<BubbleBorder> border) {
set_background(new views::BubbleBackground(bubble_border_));
}
-void BubbleFrameView::SetTitlebarExtraView(scoped_ptr<View> view) {
- if (!view)
- return;
-
- DCHECK(!titlebar_extra_view_);
- titlebar_extra_view_ = view.release();
- AddChildView(titlebar_extra_view_);
-}
-
-void BubbleFrameView::SetFootnoteView(scoped_ptr<View> view) {
+void BubbleFrameView::SetFootnoteView(View* view) {
if (!view)
return;
DCHECK(!footnote_container_);
-
footnote_container_ = new views::View();
footnote_container_->SetLayoutManager(
new BoxLayout(BoxLayout::kVertical, content_margins_.left(),
@@ -390,7 +361,7 @@ void BubbleFrameView::SetFootnoteView(scoped_ptr<View> view) {
Background::CreateSolidBackground(kFootnoteBackgroundColor));
footnote_container_->SetBorder(
Border::CreateSolidSidedBorder(1, 0, 0, 0, kFootnoteBorderColor));
- footnote_container_->AddChildView(view.release());
+ footnote_container_->AddChildView(view);
AddChildView(footnote_container_);
}
@@ -510,8 +481,6 @@ gfx::Size BubbleFrameView::GetSizeForClientSize(
title_bar_width += title_icon_size.width();
if (close_->visible())
title_bar_width += close_->width() + 1;
- if (titlebar_extra_view_)
- title_bar_width += titlebar_extra_view_->GetPreferredSize().width();
gfx::Size size(client_size);
gfx::Insets client_insets = GetInsets();

Powered by Google App Engine
This is Rietveld 408576698