Merge pull request #2424 from deepak1556/web_contents_patch
webcontents: minor patches
This commit is contained in:
commit
20a8e7838f
9 changed files with 29 additions and 4 deletions
|
@ -3,6 +3,7 @@ webContents = require 'web-contents'
|
|||
webViewManager = null # Doesn't exist in early initialization.
|
||||
|
||||
supportedWebViewEvents = [
|
||||
'load-commit'
|
||||
'did-finish-load'
|
||||
'did-fail-load'
|
||||
'did-frame-finish-load'
|
||||
|
|
|
@ -5,7 +5,9 @@
|
|||
#include "atom/browser/web_view_guest_delegate.h"
|
||||
|
||||
#include "atom/browser/api/atom_api_web_contents.h"
|
||||
#include "atom/common/native_mate_converters/gurl_converter.h"
|
||||
#include "content/public/browser/guest_host.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/render_widget_host_view.h"
|
||||
|
||||
|
@ -128,6 +130,12 @@ void WebViewGuestDelegate::RenderViewReady() {
|
|||
render_view_host_view->SetBackgroundColor(SK_ColorTRANSPARENT);
|
||||
}
|
||||
|
||||
void WebViewGuestDelegate::DidCommitProvisionalLoadForFrame(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& url, ui::PageTransition transition_type) {
|
||||
api_web_contents_->Emit("load-commit", url, !render_frame_host->GetParent());
|
||||
}
|
||||
|
||||
void WebViewGuestDelegate::DidAttach(int guest_proxy_routing_id) {
|
||||
api_web_contents_->Emit("did-attach");
|
||||
}
|
||||
|
|
|
@ -59,6 +59,9 @@ class WebViewGuestDelegate : public content::BrowserPluginGuestDelegate,
|
|||
protected:
|
||||
// content::WebContentsObserver:
|
||||
void RenderViewReady() override;
|
||||
void DidCommitProvisionalLoadForFrame(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
const GURL& url, ui::PageTransition transition_type) override;
|
||||
|
||||
// content::BrowserPluginGuestDelegate:
|
||||
void DidAttach(int guest_proxy_routing_id) final;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue