2018-05-08 12:31:47 +09:00
|
|
|
// Copyright (c) 2018 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2019-06-19 13:46:59 -07:00
|
|
|
#include "shell/browser/ui/cocoa/delayed_native_view_host.h"
|
2018-05-08 12:31:47 +09:00
|
|
|
|
2019-06-19 14:23:04 -07:00
|
|
|
namespace electron {
|
2018-05-08 12:31:47 +09:00
|
|
|
|
|
|
|
DelayedNativeViewHost::DelayedNativeViewHost(gfx::NativeView native_view)
|
|
|
|
: native_view_(native_view) {}
|
|
|
|
|
2021-06-03 21:16:13 -07:00
|
|
|
DelayedNativeViewHost::~DelayedNativeViewHost() = default;
|
2018-05-08 12:31:47 +09:00
|
|
|
|
|
|
|
void DelayedNativeViewHost::ViewHierarchyChanged(
|
2019-03-21 20:13:23 -07:00
|
|
|
const views::ViewHierarchyChangedDetails& details) {
|
2018-05-08 12:31:47 +09:00
|
|
|
NativeViewHost::ViewHierarchyChanged(details);
|
2018-05-23 13:30:57 +09:00
|
|
|
if (details.is_add && GetWidget())
|
2018-05-08 12:31:47 +09:00
|
|
|
Attach(native_view_);
|
|
|
|
}
|
|
|
|
|
2019-06-19 14:23:04 -07:00
|
|
|
} // namespace electron
|