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

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 1905033002: PlzNavigate: Move navigation-level mixed content checks to the browser. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@console-security-message
Patch Set: Rebase after 3 spin off CLs landed. Created 3 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" 5 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/feature_list.h" 10 #include "base/feature_list.h"
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/stl_util.h" 12 #include "base/stl_util.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "chrome/browser/browser_process.h" 14 #include "chrome/browser/browser_process.h"
15 #include "chrome/browser/chrome_notification_types.h" 15 #include "chrome/browser/chrome_notification_types.h"
16 #include "chrome/browser/content_settings/chrome_content_settings_utils.h" 16 #include "chrome/browser/content_settings/chrome_content_settings_utils.h"
17 #include "chrome/browser/content_settings/cookie_settings_factory.h" 17 #include "chrome/browser/content_settings/cookie_settings_factory.h"
18 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" 18 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
19 #include "chrome/browser/content_settings/mixed_content_settings.h"
20 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" 21 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
20 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 22 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
21 #include "chrome/browser/infobars/infobar_service.h" 23 #include "chrome/browser/infobars/infobar_service.h"
22 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h" 24 #include "chrome/browser/media/webrtc/media_capture_devices_dispatcher.h"
23 #include "chrome/browser/permissions/permission_uma_util.h" 25 #include "chrome/browser/permissions/permission_uma_util.h"
24 #include "chrome/browser/permissions/permission_util.h" 26 #include "chrome/browser/permissions/permission_util.h"
25 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" 27 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
26 #include "chrome/browser/plugins/plugin_utils.h" 28 #include "chrome/browser/plugins/plugin_utils.h"
27 #include "chrome/browser/profiles/profile.h" 29 #include "chrome/browser/profiles/profile.h"
28 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" 30 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h"
(...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after
1023 content_settings::RecordMixedScriptAction( 1025 content_settings::RecordMixedScriptAction(
1024 content_settings::MIXED_SCRIPT_ACTION_DISPLAYED_BUBBLE); 1026 content_settings::MIXED_SCRIPT_ACTION_DISPLAYED_BUBBLE);
1025 set_custom_link_enabled(true); 1027 set_custom_link_enabled(true);
1026 } 1028 }
1027 1029
1028 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() { 1030 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() {
1029 DCHECK(rappor_service()); 1031 DCHECK(rappor_service());
1030 if (!web_contents()) 1032 if (!web_contents())
1031 return; 1033 return;
1032 1034
1035 MixedContentSettings* mixed_content_settings =
1036 MixedContentSettings::FromWebContents(web_contents());
1037 if (mixed_content_settings) {
1038 mixed_content_settings->AllowRunningOfInsecureContent();
1039 }
1040
1033 web_contents()->SendToAllFrames( 1041 web_contents()->SendToAllFrames(
1034 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true)); 1042 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true));
1035 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame( 1043 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame(
1036 web_contents()->GetMainFrame()->GetRoutingID())); 1044 web_contents()->GetMainFrame()->GetRoutingID()));
1037 1045
1038 content_settings::RecordMixedScriptAction( 1046 content_settings::RecordMixedScriptAction(
1039 content_settings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW); 1047 content_settings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW);
1040 1048
1041 rappor::SampleDomainAndRegistryFromGURL( 1049 rappor::SampleDomainAndRegistryFromGURL(
1042 rappor_service(), "ContentSettings.MixedScript.UserClickedAllow", 1050 rappor_service(), "ContentSettings.MixedScript.UserClickedAllow",
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 ContentSettingMediaStreamBubbleModel* 1445 ContentSettingMediaStreamBubbleModel*
1438 ContentSettingBubbleModel::AsMediaStreamBubbleModel() { 1446 ContentSettingBubbleModel::AsMediaStreamBubbleModel() {
1439 // In general, bubble models might not inherit from the media bubble model. 1447 // In general, bubble models might not inherit from the media bubble model.
1440 return nullptr; 1448 return nullptr;
1441 } 1449 }
1442 1450
1443 ContentSettingSubresourceFilterBubbleModel* 1451 ContentSettingSubresourceFilterBubbleModel*
1444 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { 1452 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() {
1445 return nullptr; 1453 return nullptr;
1446 } 1454 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698