Commit 20781a35 authored by Elly Fong-Jones's avatar Elly Fong-Jones Committed by Commit Bot

views: remove WidgetDelegate::ShouldRestoreWindowSize

This method has no overrides and always returns true. This change
removes it, removes the only call to it, and simplifies code around
that call site as a result.

Bug: None
Change-Id: I2c5b13552923f11615e5b2e629fc2da70fb26eb8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2367650
Commit-Queue: Robert Liao <robliao@chromium.org>
Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800426}
parent a4017fb6
......@@ -1599,11 +1599,9 @@ bool Widget::GetSavedWindowPlacement(gfx::Rect* bounds,
// a window is restored from maximized state, so we can't more accurately
// track maximized state independently of sizing information.
// Restore the window's placement from the controller.
if (widget_delegate_->GetSavedWindowPlacement(this, bounds, show_state)) {
if (!widget_delegate_->ShouldRestoreWindowSize()) {
bounds->set_size(non_client_view_->GetPreferredSize());
} else {
if (!widget_delegate_->GetSavedWindowPlacement(this, bounds, show_state))
return false;
gfx::Size minimum_size = GetMinimumSize();
// Make sure the bounds are at least the minimum size.
if (bounds->width() < minimum_size.width())
......@@ -1611,10 +1609,7 @@ bool Widget::GetSavedWindowPlacement(gfx::Rect* bounds,
if (bounds->height() < minimum_size.height())
bounds->set_height(minimum_size.height());
}
return true;
}
return false;
}
const View::Views& Widget::GetViewsWithLayers() {
......
......@@ -153,10 +153,6 @@ bool WidgetDelegate::GetSavedWindowPlacement(
return display.bounds().Intersects(*bounds);
}
bool WidgetDelegate::ShouldRestoreWindowSize() const {
return true;
}
void WidgetDelegate::WidgetInitializing(Widget* widget) {
widget_ = widget;
OnWidgetInitializing();
......
......@@ -178,12 +178,6 @@ class VIEWS_EXPORT WidgetDelegate {
gfx::Rect* bounds,
ui::WindowShowState* show_state) const;
// Returns true if the window's size should be restored. If this is false,
// only the window's origin is restored and the window is given its
// preferred size.
// Default is true.
virtual bool ShouldRestoreWindowSize() const;
// Hooks for the end of the Widget/Window lifecycle. As of this writing, these
// callbacks happen like so:
// 1. Client code calls Widget::CloseWithReason()
......
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