Move ready-to-show to api::BrowserWindow

This commit is contained in:
Cheng Zhao 2018-02-22 14:59:39 +09:00
parent 0d9a157914
commit c256a43139
5 changed files with 31 additions and 34 deletions

View file

@ -672,22 +672,6 @@ void NativeWindow::BeforeUnloadDialogCancelled() {
window_unresposive_closure_.Cancel();
}
void NativeWindow::DidFirstVisuallyNonEmptyPaint() {
if (IsVisible())
return;
// When there is a non-empty first paint, resize the RenderWidget to force
// Chromium to draw.
const auto view = web_contents()->GetRenderWidgetHostView();
view->Show();
view->SetSize(GetContentSize());
// Emit the ReadyToShow event in next tick in case of pending drawing work.
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&NativeWindow::NotifyReadyToShow, GetWeakPtr()));
}
bool NativeWindow::OnMessageReceived(const IPC::Message& message,
content::RenderFrameHost* rfh) {
bool handled = true;
@ -731,9 +715,4 @@ void NativeWindow::NotifyWindowUnresponsive() {
}
}
void NativeWindow::NotifyReadyToShow() {
for (NativeWindowObserver& observer : observers_)
observer.OnReadyToShow();
}
} // namespace atom