Refactor NativeWindow (Part 1): Remove WebContentsObserver methods#12008
Conversation
Closing a BrowserWindow is essentially closing a WebContents, the logic should not be in NativeWindow.
18786d7 to
816a96c
Compare
|
It is weird the last commit is showing in the middle of the list, anyway the CI is correctly running for the last commit. |
| mate::Handle<class WebContents> web_contents) { | ||
| web_contents_.Reset(isolate, web_contents.ToV8()); | ||
| api_web_contents_ = web_contents.get(); | ||
| Observe(web_contents->web_contents()); |
There was a problem hiding this comment.
maybe api_web_contents_->web_contents() for clarity.
| } | ||
|
|
||
| void BrowserWindow::NotifyWindowUnresponsive() { | ||
| window_unresposive_closure_.Cancel(); |
There was a problem hiding this comment.
Is it necessary to Cancel the closure once the callback is run ? Also might be a good chance to fix window_unresposive_closure_ => window_unresponsive_closure_.
There was a problem hiding this comment.
There is code checking whether the callback is cancelled before scheduling a new unresponsive event, so this is necessary.
For some reason GitHub shows commits sorted by date, not in "true" order. |
This PR relies on #12004, and should be reviewed and merged after it.
This is part of the changes to decouple
NativeWindowfromWebContents, so it would be possible for us to implement new APIs based onNativeWindow, e.g. providing APIs to create native GUI elements without usingWebContents.This PR moves
WebContentsObservermethods ofNativeWindowintoapi::BrowserWindow. Commits have been organized to make it easier to review.