fix documentation for CreateDialogWidget
Change-Id: I9b1c7ba6ba23498862d56e0c064349d77f0a43ef Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6507111 Reviewed-by: Robert Liao <robliao@chromium.org> Commit-Queue: Robert Liao <robliao@chromium.org> Cr-Commit-Position: refs/heads/main@{#1455774}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
a76914be29
commit
a40a11cc12
@ -300,16 +300,12 @@ class VIEWS_EXPORT DialogDelegate : public WidgetDelegate {
|
||||
~DialogDelegate() override;
|
||||
|
||||
// Creates a widget at a default location.
|
||||
// There are two variant of this method. The newer one is the unique_ptr
|
||||
// method, which simply takes ownership of the WidgetDelegate and passes it to
|
||||
// the created Widget. When using the unique_ptr version, it is required that
|
||||
// delegate->owned_by_widget(). Unless you have a good reason, you should use
|
||||
// this variant.
|
||||
// The correct approach is for the client to own the WidgetDelegate via a
|
||||
// unique_ptr, and for the client to own the Widget via a unique_ptr (see
|
||||
// CLIENT_OWNS_WIDGET), and to pass the WidgetDelegate as a raw_ptr.
|
||||
//
|
||||
// If !delegate->owned_by_widget() *or* if your WidgetDelegate subclass has a
|
||||
// custom override of WidgetDelegate::DeleteDelegate, use the raw pointer
|
||||
// variant instead, and please talk to one of the //ui/views owners about
|
||||
// your use case.
|
||||
// The unique_ptr variant is deprecated and requires calling
|
||||
// WidgetDelegate::SetOwnedByWidget().
|
||||
static Widget* CreateDialogWidget(std::unique_ptr<WidgetDelegate> delegate,
|
||||
gfx::NativeWindow context,
|
||||
gfx::NativeView parent);
|
||||
|
Reference in New Issue
Block a user