mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-01-16 20:02:24 +01:00
8aac23386e
- Implement CefRequestHandler::OnBeforeBrowse using NavigationThrottle instead of ResourceThrottle (see http://crbug.com/537634). The CefRequest object passed to OnBeforeBrowse will no longer have an associated request identifier. - Mac: Remove additional helper apps which are no longer required (see http://crbug.com/520680) - Remove the UR_FLAG_REPORT_RAW_HEADERS flag which is no longer supported (see http://crbug.com/517114) - Remove the CefBrowserSettings.java parameter. Java is an NPAPI plugin and NPAPI plugins are no longer supported (see http://crbug.com/470301#c11) - Add CefFormatUrlForSecurityDisplay function in cef_parser.h - Fix crash when passing `--disable-extensions` command-line flag (issue #1721) - Linux: Fix NSS handler loading (issue #1727)
133 lines
4.9 KiB
Diff
133 lines
4.9 KiB
Diff
diff --git mime_handler_view_guest.cc mime_handler_view_guest.cc
|
|
index aee7d72..951d0cc 100644
|
|
--- mime_handler_view_guest.cc
|
|
+++ mime_handler_view_guest.cc
|
|
@@ -131,6 +131,8 @@ void MimeHandlerViewGuest::CreateWebContents(
|
|
WebContents::CreateParams params(browser_context(),
|
|
guest_site_instance.get());
|
|
params.guest_delegate = this;
|
|
+ if (delegate_)
|
|
+ delegate_->OverrideWebContentsCreateParams(¶ms);
|
|
callback.Run(WebContents::Create(params));
|
|
}
|
|
|
|
@@ -155,6 +157,30 @@ bool MimeHandlerViewGuest::ZoomPropagatesFromEmbedderToGuest() const {
|
|
return false;
|
|
}
|
|
|
|
+void MimeHandlerViewGuest::OnGuestAttached(
|
|
+ content::WebContentsView* guest_view,
|
|
+ content::WebContentsView* parent_view) {
|
|
+ if (!delegate_ || !delegate_->OnGuestAttached(guest_view, parent_view))
|
|
+ BrowserPluginGuestDelegate::OnGuestAttached(guest_view, parent_view);
|
|
+}
|
|
+
|
|
+void MimeHandlerViewGuest::OnGuestDetached(
|
|
+ content::WebContentsView* guest_view,
|
|
+ content::WebContentsView* parent_view) {
|
|
+ if (!delegate_ || !delegate_->OnGuestDetached(guest_view, parent_view))
|
|
+ BrowserPluginGuestDelegate::OnGuestDetached(guest_view, parent_view);
|
|
+}
|
|
+
|
|
+void MimeHandlerViewGuest::CreateViewForWidget(
|
|
+ content::WebContentsView* guest_view,
|
|
+ content::RenderWidgetHost* render_widget_host) {
|
|
+ if (!delegate_ ||
|
|
+ !delegate_->CreateViewForWidget(guest_view, render_widget_host)) {
|
|
+ BrowserPluginGuestDelegate::CreateViewForWidget(guest_view,
|
|
+ render_widget_host);
|
|
+ }
|
|
+}
|
|
+
|
|
WebContents* MimeHandlerViewGuest::OpenURLFromTab(
|
|
WebContents* source,
|
|
const content::OpenURLParams& params) {
|
|
diff --git mime_handler_view_guest.h mime_handler_view_guest.h
|
|
index 26c0e11..a568b45 100644
|
|
--- mime_handler_view_guest.h
|
|
+++ mime_handler_view_guest.h
|
|
@@ -67,6 +67,15 @@ class MimeHandlerViewGuest :
|
|
bool ShouldHandleFindRequestsForEmbedder() const override;
|
|
bool ZoomPropagatesFromEmbedderToGuest() const override;
|
|
|
|
+ // content::BrowserPluginGuestDelegate implementation
|
|
+ void OnGuestAttached(content::WebContentsView* guest_view,
|
|
+ content::WebContentsView* parent_view) override;
|
|
+ void OnGuestDetached(content::WebContentsView* guest_view,
|
|
+ content::WebContentsView* parent_view) override;
|
|
+ void CreateViewForWidget(
|
|
+ content::WebContentsView* guest_view,
|
|
+ content::RenderWidgetHost* render_widget_host) override;
|
|
+
|
|
// WebContentsDelegate implementation.
|
|
content::WebContents* OpenURLFromTab(
|
|
content::WebContents* source,
|
|
diff --git mime_handler_view_guest_delegate.cc mime_handler_view_guest_delegate.cc
|
|
index 63b81b8..0f63f48 100644
|
|
--- mime_handler_view_guest_delegate.cc
|
|
+++ mime_handler_view_guest_delegate.cc
|
|
@@ -6,6 +6,24 @@
|
|
|
|
namespace extensions {
|
|
|
|
+bool MimeHandlerViewGuestDelegate::OnGuestAttached(
|
|
+ content::WebContentsView* guest_view,
|
|
+ content::WebContentsView* parent_view) {
|
|
+ return false;
|
|
+}
|
|
+
|
|
+bool MimeHandlerViewGuestDelegate::OnGuestDetached(
|
|
+ content::WebContentsView* guest_view,
|
|
+ content::WebContentsView* parent_view) {
|
|
+ return false;
|
|
+}
|
|
+
|
|
+bool MimeHandlerViewGuestDelegate::CreateViewForWidget(
|
|
+ content::WebContentsView* guest_view,
|
|
+ content::RenderWidgetHost* render_widget_host) {
|
|
+ return false;
|
|
+}
|
|
+
|
|
bool MimeHandlerViewGuestDelegate::HandleContextMenu(
|
|
content::WebContents* web_contents,
|
|
const content::ContextMenuParams& params) {
|
|
diff --git mime_handler_view_guest_delegate.h mime_handler_view_guest_delegate.h
|
|
index e065104d..f68b66c 100644
|
|
--- mime_handler_view_guest_delegate.h
|
|
+++ mime_handler_view_guest_delegate.h
|
|
@@ -6,10 +6,11 @@
|
|
#define EXTENSIONS_BROWSER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_GUEST_DELEGATE_H_
|
|
|
|
#include "base/macros.h"
|
|
+#include "content/public/browser/web_contents.h"
|
|
|
|
namespace content {
|
|
-class WebContents;
|
|
struct ContextMenuParams;
|
|
+class RenderWidgetHost;
|
|
} // namespace content
|
|
|
|
namespace extensions {
|
|
@@ -21,6 +22,21 @@ class MimeHandlerViewGuestDelegate {
|
|
public:
|
|
MimeHandlerViewGuestDelegate() {}
|
|
virtual ~MimeHandlerViewGuestDelegate() {}
|
|
+
|
|
+ // Provides an opportunity to supply a custom view implementation.
|
|
+ virtual void OverrideWebContentsCreateParams(
|
|
+ content::WebContents::CreateParams* params) {}
|
|
+
|
|
+ // Called when a guest is attached or detached.
|
|
+ virtual bool OnGuestAttached(content::WebContentsView* guest_view,
|
|
+ content::WebContentsView* parent_view);
|
|
+ virtual bool OnGuestDetached(content::WebContentsView* guest_view,
|
|
+ content::WebContentsView* parent_view);
|
|
+
|
|
+ // Called to create the view for the widget.
|
|
+ virtual bool CreateViewForWidget(
|
|
+ content::WebContentsView* guest_view,
|
|
+ content::RenderWidgetHost* render_widget_host);
|
|
|
|
// Handles context menu, or returns false if unhandled.
|
|
virtual bool HandleContextMenu(content::WebContents* web_contents,
|