| Index: chrome/renderer/content_settings_observer.cc
|
| diff --git a/chrome/renderer/content_settings_observer.cc b/chrome/renderer/content_settings_observer.cc
|
| index 3a696956517d71405d91a2af216ebeda22e939fe..34608a6daaf4291f00cce463d3034ab5405ff613 100644
|
| --- a/chrome/renderer/content_settings_observer.cc
|
| +++ b/chrome/renderer/content_settings_observer.cc
|
| @@ -11,6 +11,7 @@
|
| #include "content/public/renderer/render_frame.h"
|
| #include "content/public/renderer/render_view.h"
|
| #include "extensions/features/features.h"
|
| +#include "services/service_manager/public/cpp/interface_registry.h"
|
| #include "third_party/WebKit/public/platform/URLConversion.h"
|
| #include "third_party/WebKit/public/platform/WebContentSettingCallbacks.h"
|
| #include "third_party/WebKit/public/platform/WebSecurityOrigin.h"
|
| @@ -104,6 +105,10 @@ ContentSettingsObserver::ContentSettingsObserver(
|
| ClearBlockedContentSettings();
|
| render_frame->GetWebFrame()->setContentSettingsClient(this);
|
|
|
| + render_frame->GetInterfaceRegistry()->AddInterface(
|
| + base::Bind(&ContentSettingsObserver::OnInsecureContentRendererRequest,
|
| + base::Unretained(this)));
|
| +
|
| content::RenderFrame* main_frame =
|
| render_frame->GetRenderView()->GetMainRenderFrame();
|
| // TODO(nasko): The main frame is not guaranteed to be in the same process
|
| @@ -158,9 +163,6 @@ bool ContentSettingsObserver::OnMessageReceived(const IPC::Message& message) {
|
| bool handled = true;
|
| IPC_BEGIN_MESSAGE_MAP(ContentSettingsObserver, message)
|
| IPC_MESSAGE_HANDLER(ChromeViewMsg_SetAsInterstitial, OnSetAsInterstitial)
|
| - IPC_MESSAGE_HANDLER(ChromeViewMsg_SetAllowRunningInsecureContent,
|
| - OnSetAllowRunningInsecureContent)
|
| - IPC_MESSAGE_HANDLER(ChromeViewMsg_ReloadFrame, OnReloadFrame);
|
| IPC_MESSAGE_HANDLER(ChromeViewMsg_RequestFileSystemAccessAsyncResponse,
|
| OnRequestFileSystemAccessAsyncResponse)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| @@ -205,6 +207,20 @@ void ContentSettingsObserver::OnDestruct() {
|
| delete this;
|
| }
|
|
|
| +void ContentSettingsObserver::SetAllowRunningInsecureContent() {
|
| + allow_running_insecure_content_ = true;
|
| +
|
| + // Reload if we are the main frame.
|
| + blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
|
| + if (!frame->parent())
|
| + frame->reload(blink::WebFrameLoadType::ReloadMainResource);
|
| +}
|
| +
|
| +void ContentSettingsObserver::OnInsecureContentRendererRequest(
|
| + chrome::mojom::InsecureContentRendererRequest request) {
|
| + insecure_content_renderer_bindings_.AddBinding(this, std::move(request));
|
| +}
|
| +
|
| bool ContentSettingsObserver::allowDatabase(const WebString& name,
|
| const WebString& display_name,
|
| unsigned estimated_size) {
|
| @@ -434,17 +450,6 @@ void ContentSettingsObserver::OnSetAsInterstitial() {
|
| is_interstitial_page_ = true;
|
| }
|
|
|
| -void ContentSettingsObserver::OnSetAllowRunningInsecureContent(bool allow) {
|
| - allow_running_insecure_content_ = allow;
|
| -}
|
| -
|
| -void ContentSettingsObserver::OnReloadFrame() {
|
| - DCHECK(!render_frame()->GetWebFrame()->parent()) <<
|
| - "Should only be called on the main frame";
|
| - render_frame()->GetWebFrame()->reload(
|
| - blink::WebFrameLoadType::ReloadMainResource);
|
| -}
|
| -
|
| void ContentSettingsObserver::OnRequestFileSystemAccessAsyncResponse(
|
| int request_id,
|
| bool allowed) {
|
|
|