0

Adjust Selected aura::Window::SetLayoutManager Calls To Use the std::unique_ptr Version

Bug: 1359135
Change-Id: I680913dc26a6494296040b8f089b577a432ec887
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3902259
Commit-Queue: Robert Liao <robliao@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Auto-Submit: Robert Liao <robliao@chromium.org>
Reviewed-by: Allen Bauer <kylixrd@chromium.org>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: Wez <wez@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1050346}
This commit is contained in:
Robert Liao
2022-09-22 19:51:23 +00:00
committed by Chromium LUCI CQ
parent 8bf6ed4423
commit 2e86061330
4 changed files with 9 additions and 7 deletions
content/shell/browser
extensions/shell/browser
fuchsia_web/webengine/browser
ui/views/widget

@ -100,7 +100,8 @@ ShellPlatformDataAura::ShellPlatformDataAura(const gfx::Size& initial_size) {
host_ = aura::WindowTreeHost::Create(std::move(properties));
host_->InitHost();
host_->window()->Show();
host_->window()->SetLayoutManager(new FillLayout(host_->window()));
host_->window()->SetLayoutManager(
std::make_unique<FillLayout>(host_->window()));
focus_client_ =
std::make_unique<aura::test::TestFocusClient>(host_->window());

@ -115,7 +115,8 @@ RootWindowController::RootWindowController(
std::make_unique<ScreenPositionClient>(host_->window());
// Ensure the window fills the display.
host_->window()->SetLayoutManager(new FillLayout(host_->window()));
host_->window()->SetLayoutManager(
std::make_unique<FillLayout>(host_->window()));
host_->AddObserver(this);
host_->Show();

@ -1099,8 +1099,8 @@ void FrameImpl::InitWindowTreeHost() {
wm::SetActivationClient(root_window(), focus_controller_.get());
layout_manager_ = new FrameLayoutManager;
root_window()->SetLayoutManager(layout_manager_); // Transfers ownership.
layout_manager_ =
root_window()->SetLayoutManager(std::make_unique<FrameLayoutManager>());
if (!render_size_override_.IsEmpty())
layout_manager_->ForceContentDimensions(render_size_override_);

@ -414,7 +414,7 @@ class TestWidget : public Widget {
// leads to noticable flashes.
TEST_F(NativeWidgetAuraTest, ShowMaximizedDoesntBounceAround) {
root_window()->SetBounds(gfx::Rect(0, 0, 640, 480));
root_window()->SetLayoutManager(new MaximizeLayoutManager);
root_window()->SetLayoutManager(std::make_unique<MaximizeLayoutManager>());
UniqueWidgetPtr widget = std::make_unique<TestWidget>();
Widget::InitParams params(Widget::InitParams::TYPE_WINDOW);
params.parent = nullptr;
@ -454,8 +454,8 @@ class PropertyTestLayoutManager : public TestLayoutManagerBase {
// Verifies the resize behavior when added to the layout manager.
TEST_F(NativeWidgetAuraTest, TestPropertiesWhenAddedToLayout) {
root_window()->SetBounds(gfx::Rect(0, 0, 640, 480));
PropertyTestLayoutManager* layout_manager = new PropertyTestLayoutManager();
root_window()->SetLayoutManager(layout_manager);
PropertyTestLayoutManager* layout_manager = root_window()->SetLayoutManager(
std::make_unique<PropertyTestLayoutManager>());
UniqueWidgetPtr widget = std::make_unique<TestWidget>();
Widget::InitParams params(Widget::InitParams::TYPE_WINDOW);
params.delegate = new WidgetDelegate();