fix: adjust initial webContents focus calculation (#29204)

* fix: adjust initial webContents focus calculation

* fix: active window check on mac

* fix: about:blank focus behavior

* chore: add spec

Co-authored-by: Raymond Zhao <raymondzhao@microsoft.com>
This commit is contained in:
Robo 2021-05-19 02:27:35 -07:00 committed by GitHub
parent 014bdc9f8a
commit 77297f37a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 70 additions and 28 deletions

View file

@ -324,7 +324,6 @@ class WebContents : public gin::Wrappable<WebContents>,
content::WebContents* HostWebContents() const;
v8::Local<v8::Value> DevToolsWebContents(v8::Isolate* isolate);
v8::Local<v8::Value> Debugger(v8::Isolate* isolate);
bool WasInitiallyShown();
content::RenderFrameHost* MainFrame();
WebContentsZoomController* GetZoomController() { return zoom_controller_; }
@ -559,6 +558,8 @@ class WebContents : public gin::Wrappable<WebContents>,
content::NavigationHandle* navigation_handle) override;
void DidRedirectNavigation(
content::NavigationHandle* navigation_handle) override;
void ReadyToCommitNavigation(
content::NavigationHandle* navigation_handle) override;
void DidFinishNavigation(
content::NavigationHandle* navigation_handle) override;
bool OnMessageReceived(const IPC::Message& message) override;
@ -722,8 +723,6 @@ class WebContents : public gin::Wrappable<WebContents>,
v8::Global<v8::Value> pending_child_web_preferences_;
bool initially_shown_ = true;
// The window that this WebContents belongs to.
base::WeakPtr<NativeWindow> owner_window_;