Merge pull request #1386 from deepak1556/web_contents_patch

webContents: event to detect status of requested resource
This commit is contained in:
Cheng Zhao 2015-04-13 11:59:37 +08:00
commit 64f9f7e906
7 changed files with 49 additions and 0 deletions

View file

@ -224,6 +224,17 @@ void WebContents::DidStopLoading(content::RenderViewHost* render_view_host) {
Emit("did-stop-loading");
}
void WebContents::DidGetResourceResponseStart(
const content::ResourceRequestDetails& details) {
Emit("did-get-response-details",
details.socket_address.IsEmpty(),
details.url,
details.original_url,
details.http_response_code,
details.method,
details.referrer);
}
void WebContents::DidGetRedirectForResourceRequest(
content::RenderFrameHost* render_frame_host,
const content::ResourceRedirectDetails& details) {

View file

@ -161,6 +161,8 @@ class WebContents : public mate::EventEmitter,
const base::string16& error_description) override;
void DidStartLoading(content::RenderViewHost* render_view_host) override;
void DidStopLoading(content::RenderViewHost* render_view_host) override;
void DidGetResourceResponseStart(
const content::ResourceRequestDetails& details) override;
void DidGetRedirectForResourceRequest(
content::RenderFrameHost* render_frame_host,
const content::ResourceRedirectDetails& details) override;