Add ready-to-show event
This commit is contained in:
parent
2dc453b4be
commit
4d65af3c60
5 changed files with 29 additions and 0 deletions
|
@ -560,6 +560,19 @@ void NativeWindow::BeforeUnloadDialogCancelled() {
|
|||
window_unresposive_closure_.Cancel();
|
||||
}
|
||||
|
||||
void NativeWindow::DidFirstVisuallyNonEmptyPaint() {
|
||||
// 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::MessageLoop::current()->PostTask(
|
||||
FROM_HERE,
|
||||
base::Bind(&NativeWindow::NotifyReadyToShow, GetWeakPtr()));
|
||||
}
|
||||
|
||||
bool NativeWindow::OnMessageReceived(const IPC::Message& message) {
|
||||
bool handled = true;
|
||||
IPC_BEGIN_MESSAGE_MAP(NativeWindow, message)
|
||||
|
@ -601,6 +614,10 @@ void NativeWindow::NotifyWindowUnresponsive() {
|
|||
OnRendererUnresponsive());
|
||||
}
|
||||
|
||||
void NativeWindow::NotifyReadyToShow() {
|
||||
FOR_EACH_OBSERVER(NativeWindowObserver, observers_, OnReadyToShow());
|
||||
}
|
||||
|
||||
void NativeWindow::OnCapturePageDone(const CapturePageCallback& callback,
|
||||
const SkBitmap& bitmap,
|
||||
content::ReadbackResponse response) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue