8000 fix: HTML5 fullscreen APIs not working in <webview> by miniak · Pull Request #20432 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: HTML 8000 5 fullscreen APIs not working in <webview> #20432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions atom/browser/api/atom_api_web_contents.cc
Original file line number Diff line number Diff line change
Expand Up @@ -983,8 +983,7 @@ void WebContents::DevToolsOpened() {

// Inherit owner window in devtools when it doesn't have one.
auto* devtools = managed_web_contents()->GetDevToolsWebContents();
bool has_window =
devtools->GetUserData(NativeWindowRelay::kNativeWindowRelayUserDataKey);
bool has_window = devtools->GetUserData(NativeWindowRelay::UserDataKey());
if (owner_window() && !has_window)
handle->SetOwnerWindow(devtools, owner_window());

Expand Down
3 changes: 1 addition & 2 deletions atom/browser/common_web_contents_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,7 @@ void CommonWebContentsDelegate::SetOwnerWindow(
owner_window->GetWeakPtr());
} else {
owner_window_ = nullptr;
web_contents->RemoveUserData(
NativeWindowRelay::kNativeWindowRelayUserDataKey);
web_contents->RemoveUserData(NativeWindowRelay::UserDataKey());
}
#if BUILDFLAG(ENABLE_OSR)
auto* osr_wcv = GetOffScreenWebContentsView();
Expand Down
11 changes: 4 additions & 7 deletions atom/browser/native_window.cc
Original file line number Diff line number Diff line change
Expand Up @@ -575,18 +575,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)
Expand Down
7 changes: 5 additions & 2 deletions atom/browser/native_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -354,15 +354,18 @@ class NativeWindow : public base::SupportsUserData,
class NativeWindowRelay
: public content::WebContentsUserData<NativeWindowRelay> {
public:
static const void* const kNativeWindowRelayUserDataKey;

static void CreateForWebContents(content::WebContents*,
base::WeakPtr<NativeWindow>);

~NativeWindowRelay() override;

NativeWindow* GetNativeWindow() const { return native_window_.get(); }

// UserDataKey() is protected in content::WebContentsUserData<T>
static inline const void* UserDataKey() {
return content::WebContentsUserData<NativeWindowRelay>::UserDataKey();
}

private:
friend class content::WebContentsUserData<NativeWindow>;
explicit NativeWindowRelay(base::WeakPtr<NativeWindow> window);
Expand Down
0