mirror of
https://github.com/Alex313031/thorium.git
synced 2025-01-10 03:47:44 -03:00
Update shell_platform_delegate_views.cc
This commit is contained in:
parent
0b2e2e3e59
commit
5340fa043a
1 changed files with 7 additions and 5 deletions
|
@ -1,4 +1,4 @@
|
|||
// Copyright 2020 The Chromium Authors. All rights reserved.
|
||||
// Copyright 2022 The Chromium Authors and Alex313031. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
|
@ -99,9 +99,11 @@ class ShellView : public views::BoxLayoutView,
|
|||
void SetWebContents(WebContents* web_contents, const gfx::Size& size) {
|
||||
// If there was a previous WebView in this Shell it should be removed and
|
||||
// deleted.
|
||||
if (web_view_)
|
||||
contents_view_->RemoveChildViewT(web_view_.get());
|
||||
|
||||
if (web_view_) {
|
||||
// ExtractAsDangling clears the underlying pointer and returns another
|
||||
// raw_ptr instance that is allowed to dangle.
|
||||
contents_view_->RemoveChildViewT(web_view_.ExtractAsDangling().get());
|
||||
}
|
||||
views::Builder<views::View>(contents_view_)
|
||||
.AddChild(views::Builder<views::WebView>()
|
||||
.CopyAddressTo(&web_view_)
|
||||
|
@ -304,7 +306,7 @@ class ShellView : public views::BoxLayoutView,
|
|||
|
||||
// Contents view contains the web contents view
|
||||
raw_ptr<views::View> contents_view_ = nullptr;
|
||||
raw_ptr<views::WebView, DanglingUntriaged> web_view_ = nullptr;
|
||||
raw_ptr<views::WebView> web_view_ = nullptr;
|
||||
};
|
||||
|
||||
BEGIN_METADATA(ShellView, views::View)
|
||||
|
|
Loading…
Reference in a new issue