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

Unified Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.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/browser/chrome_content_renderer_manifest_overlay.json ('k') | chrome/common/BUILD.gn » ('j') | no next file with comments »
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..defce72bc6c54d54b67bcbc87c692d6cd2b183b5 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"
@@ -1014,6 +1016,16 @@ void ContentSettingDomainListBubbleModel::OnCustomLinkClicked() {
// ContentSettingMixedScriptBubbleModel ----------------------------------------
+namespace {
+
+void SetAllowRunningInsecureContent(content::RenderFrameHost* frame) {
+ chrome::mojom::InsecureContentRendererPtr renderer;
+ frame->GetRemoteInterfaces()->GetInterface(&renderer);
+ renderer->SetAllowRunningInsecureContent();
+}
+
+} // namespace
+
class ContentSettingMixedScriptBubbleModel
: public ContentSettingSimpleBubbleModel {
public:
@@ -1048,10 +1060,7 @@ 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));
content_settings::RecordMixedScriptAction(
content_settings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW);
« no previous file with comments | « chrome/browser/chrome_content_renderer_manifest_overlay.json ('k') | chrome/common/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698