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

Unified Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 2674843002: Convert ChromeViewMsg_SetAllowRunningInsecureContent to use mojo. (Closed)
Patch Set: 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 | « no previous file | chrome/common/BUILD.gn » ('j') | chrome/common/insecure_content_renderer.mojom » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/content_settings/content_setting_bubble_model.cc
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
index 409674f5417c876aaf098a3fd82060e76c3ae2ff..c33b51ae2c1b6ff66676ee382474ac0d6565bd7c 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -30,6 +30,7 @@
#include "chrome/browser/ui/content_settings/content_setting_bubble_model_delegate.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/insecure_content_renderer.mojom.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/render_messages.h"
#include "chrome/grit/generated_resources.h"
@@ -52,6 +53,7 @@
#include "content/public/browser/web_contents_delegate.h"
#include "content/public/common/origin_util.h"
#include "ppapi/features/features.h"
+#include "services/service_manager/public/cpp/interface_provider.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/resources/grit/ui_resources.h"
@@ -1026,6 +1028,10 @@ class ContentSettingMixedScriptBubbleModel
private:
void OnCustomLinkClicked() override;
+ static void SetAllowRunningInsecureContent(
Sam McNally 2017/02/03 17:36:58 Make this a function in the anonymous namespace.
nigeltao1 2017/02/04 06:29:09 Done.
+ content::RenderFrameHost* main_frame,
+ content::RenderFrameHost* frame);
+
DISALLOW_COPY_AND_ASSIGN(ContentSettingMixedScriptBubbleModel);
};
@@ -1048,10 +1054,9 @@ void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() {
if (!web_contents())
return;
- web_contents()->SendToAllFrames(
- new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true));
- web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame(
- web_contents()->GetMainFrame()->GetRoutingID()));
+ web_contents()->ForEachFrame(
+ base::Bind(&SetAllowRunningInsecureContent,
+ base::Unretained(web_contents()->GetMainFrame())));
content_settings::RecordMixedScriptAction(
content_settings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW);
@@ -1061,6 +1066,15 @@ void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() {
web_contents()->GetLastCommittedURL());
}
+// static
+void ContentSettingMixedScriptBubbleModel::SetAllowRunningInsecureContent(
+ content::RenderFrameHost* main_frame,
+ content::RenderFrameHost* frame) {
+ chrome::mojom::InsecureContentRendererPtr renderer;
+ frame->GetRemoteInterfaces()->GetInterface(&renderer);
+ renderer->SetAllowRunningInsecureContent(true, main_frame == frame);
+}
+
// ContentSettingRPHBubbleModel ------------------------------------------------
ContentSettingRPHBubbleModel::ContentSettingRPHBubbleModel(
« no previous file with comments | « no previous file | chrome/common/BUILD.gn » ('j') | chrome/common/insecure_content_renderer.mojom » ('J')

Powered by Google App Engine
This is Rietveld 408576698