Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Unified Diff: chrome/renderer/content_settings_observer.cc

Issue 2674843002: Convert ChromeViewMsg_SetAllowRunningInsecureContent to use mojo. (Closed)
Patch Set: Convert ChromeViewMsg_SetAllowRunningInsecureContent to use mojo. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/renderer/content_settings_observer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « chrome/renderer/content_settings_observer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698