Skip to content
This repository has been archived by the owner on Jan 4, 2019. It is now read-only.

Commit

Permalink
add load-start event
Browse files Browse the repository at this point in the history
auditors: @bbondy
  • Loading branch information
bridiver authored and bbondy committed Feb 19, 2016
1 parent 31779c3 commit 7db4fae
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
1 change: 1 addition & 0 deletions atom/browser/lib/guest-view-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ var slice = [].slice;
var webViewManager = null;

var supportedWebViewEvents = [
'load-start',
'load-commit',
'did-finish-load',
'did-fail-load',
Expand Down
9 changes: 9 additions & 0 deletions atom/browser/web_view_guest_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,15 @@ void WebViewGuestDelegate::RenderViewReady() {
render_view_host_view->SetBackgroundColor(SK_ColorTRANSPARENT);
}

void WebViewGuestDelegate::DidStartProvisionalLoadForFrame(
content::RenderFrameHost* render_frame_host,
const GURL& url,
bool is_error_page,
bool is_iframe_srcdoc) {
api_web_contents_->Emit("load-start", url, !render_frame_host->GetParent(),

This comment has been minimized.

Copy link
@bbondy

bbondy Feb 19, 2016

Member

This isn't firing for _blank targets so url and https status and etc doesn't get updated currently in browser-laptop

is_error_page, is_iframe_srcdoc);
}

void WebViewGuestDelegate::DidCommitProvisionalLoadForFrame(
content::RenderFrameHost* render_frame_host,
const GURL& url, ui::PageTransition transition_type) {
Expand Down
5 changes: 5 additions & 0 deletions atom/browser/web_view_guest_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
protected:
// content::WebContentsObserver:
void RenderViewReady() override;
void DidStartProvisionalLoadForFrame(
content::RenderFrameHost* render_frame_host,
const GURL& validated_url,
bool is_error_page,
bool is_iframe_srcdoc) override;
void DidCommitProvisionalLoadForFrame(
content::RenderFrameHost* render_frame_host,
const GURL& url, ui::PageTransition transition_type) override;
Expand Down
1 change: 1 addition & 0 deletions atom/renderer/lib/web-view/guest-view-internal.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ var slice = [].slice;
var requestId = 0;

var WEB_VIEW_EVENTS = {
'load-start': ['url', 'isMainFrame', 'isErrorPage', 'isFrameSrcDoc'],
'load-commit': ['url', 'isMainFrame'],
'did-finish-load': [],
'did-fail-load': ['errorCode', 'errorDescription', 'validatedURL'],
Expand Down

0 comments on commit 7db4fae

Please sign in to comment.