parent
a864167d46
commit
9439ac108d
16 changed files with 48 additions and 15 deletions
|
@ -577,18 +577,15 @@ const views::Widget* NativeWindow::GetWidget() const {
|
|||
return widget();
|
||||
}
|
||||
|
||||
// static
|
||||
const void* const NativeWindowRelay::kNativeWindowRelayUserDataKey =
|
||||
&NativeWindowRelay::kNativeWindowRelayUserDataKey;
|
||||
|
||||
// static
|
||||
void NativeWindowRelay::CreateForWebContents(
|
||||
content::WebContents* web_contents,
|
||||
base::WeakPtr<NativeWindow> window) {
|
||||
DCHECK(web_contents);
|
||||
DCHECK(!web_contents->GetUserData(kNativeWindowRelayUserDataKey));
|
||||
web_contents->SetUserData(kNativeWindowRelayUserDataKey,
|
||||
base::WrapUnique(new NativeWindowRelay(window)));
|
||||
if (!web_contents->GetUserData(UserDataKey())) {
|
||||
web_contents->SetUserData(UserDataKey(),
|
||||
base::WrapUnique(new NativeWindowRelay(window)));
|
||||
}
|
||||
}
|
||||
|
||||
NativeWindowRelay::NativeWindowRelay(base::WeakPtr<NativeWindow> window)
|
||||
|
@ -596,4 +593,6 @@ NativeWindowRelay::NativeWindowRelay(base::WeakPtr<NativeWindow> window)
|
|||
|
||||
NativeWindowRelay::~NativeWindowRelay() = default;
|
||||
|
||||
WEB_CONTENTS_USER_DATA_KEY_IMPL(NativeWindowRelay)
|
||||
|
||||
} // namespace atom
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue