Skip to content

Commit c734670

Browse files
committed
add Window progress event
1 parent 356d3d5 commit c734670

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/nw_shell.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,10 @@ void Shell::LoadingStateChanged(WebContents* source, bool to_different_document)
545545
SendEvent("loaded");
546546
}
547547

548+
void Shell::LoadProgressChanged(content::WebContents* source, double progress) {
549+
SendEvent("progress", std::to_string(progress));
550+
}
551+
548552
void Shell::ActivateContents(content::WebContents* contents) {
549553
window()->Focus(true);
550554
}

src/nw_shell.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ class Shell : public WebContentsDelegate,
163163
const OpenURLParams& params) override;
164164
void LoadingStateChanged(WebContents* source,
165165
bool to_different_document) override;
166+
void LoadProgressChanged(content::WebContents* source,
167+
double progress) override;
166168
void ActivateContents(content::WebContents* contents) override;
167169
void DeactivateContents(content::WebContents* contents) override;
168170
void CloseContents(WebContents* source) override;

0 commit comments

Comments
 (0)