Commit a1b5d24a authored by Robert Liao's avatar Robert Liao Committed by Commit Bot

Use FillLayout in RelaunchRequiredDialogView

BUG=1005568

Change-Id: I36dd422d65620ac945bd139b41afd274f2837f0f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1820045
Auto-Submit: Robert Liao <robliao@chromium.org>
Commit-Queue: Greg Thompson <grt@chromium.org>
Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#699234}
parent 81f37314
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include "ui/gfx/text_constants.h" #include "ui/gfx/text_constants.h"
#include "ui/views/border.h" #include "ui/views/border.h"
#include "ui/views/controls/label.h" #include "ui/views/controls/label.h"
#include "ui/views/layout/fill_layout.h"
#include "ui/views/layout/layout_provider.h" #include "ui/views/layout/layout_provider.h"
#include "ui/views/style/typography.h" #include "ui/views/style/typography.h"
#include "ui/views/view.h" #include "ui/views/view.h"
...@@ -107,16 +108,6 @@ bool RelaunchRequiredDialogView::ShouldShowWindowIcon() const { ...@@ -107,16 +108,6 @@ bool RelaunchRequiredDialogView::ShouldShowWindowIcon() const {
return true; return true;
} }
int RelaunchRequiredDialogView::GetHeightForWidth(int width) const {
const gfx::Insets insets = GetInsets();
return body_label_->GetHeightForWidth(width - insets.width()) +
insets.height();
}
void RelaunchRequiredDialogView::Layout() {
body_label_->SetBoundsRect(GetContentsBounds());
}
gfx::Size RelaunchRequiredDialogView::CalculatePreferredSize() const { gfx::Size RelaunchRequiredDialogView::CalculatePreferredSize() const {
const int width = ChromeLayoutProvider::Get()->GetDistanceMetric( const int width = ChromeLayoutProvider::Get()->GetDistanceMetric(
DISTANCE_MODAL_DIALOG_PREFERRED_WIDTH) - DISTANCE_MODAL_DIALOG_PREFERRED_WIDTH) -
...@@ -135,6 +126,7 @@ RelaunchRequiredDialogView::RelaunchRequiredDialogView( ...@@ -135,6 +126,7 @@ RelaunchRequiredDialogView::RelaunchRequiredDialogView(
deadline, deadline,
base::BindRepeating(&RelaunchRequiredDialogView::UpdateWindowTitle, base::BindRepeating(&RelaunchRequiredDialogView::UpdateWindowTitle,
base::Unretained(this))) { base::Unretained(this))) {
SetLayoutManager(std::make_unique<views::FillLayout>());
chrome::RecordDialogCreation(chrome::DialogIdentifier::RELAUNCH_REQUIRED); chrome::RecordDialogCreation(chrome::DialogIdentifier::RELAUNCH_REQUIRED);
set_margins(ChromeLayoutProvider::Get()->GetDialogInsetsForContentType( set_margins(ChromeLayoutProvider::Get()->GetDialogInsetsForContentType(
views::TEXT, views::TEXT)); views::TEXT, views::TEXT));
......
...@@ -48,8 +48,6 @@ class RelaunchRequiredDialogView : views::DialogDelegateView { ...@@ -48,8 +48,6 @@ class RelaunchRequiredDialogView : views::DialogDelegateView {
bool ShouldShowCloseButton() const override; bool ShouldShowCloseButton() const override;
gfx::ImageSkia GetWindowIcon() override; gfx::ImageSkia GetWindowIcon() override;
bool ShouldShowWindowIcon() const override; bool ShouldShowWindowIcon() const override;
int GetHeightForWidth(int width) const override;
void Layout() override;
protected: protected:
// views::DialogDelegateView: // views::DialogDelegateView:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment