OLD | NEW |
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 1013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 content_settings::RecordMixedScriptAction( | 1044 content_settings::RecordMixedScriptAction( |
1043 content_settings::MIXED_SCRIPT_ACTION_DISPLAYED_BUBBLE); | 1045 content_settings::MIXED_SCRIPT_ACTION_DISPLAYED_BUBBLE); |
1044 set_custom_link_enabled(true); | 1046 set_custom_link_enabled(true); |
1045 } | 1047 } |
1046 | 1048 |
1047 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() { | 1049 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() { |
1048 DCHECK(rappor_service()); | 1050 DCHECK(rappor_service()); |
1049 if (!web_contents()) | 1051 if (!web_contents()) |
1050 return; | 1052 return; |
1051 | 1053 |
| 1054 MixedContentSettings* mixed_content_settings = |
| 1055 MixedContentSettings::FromWebContents(web_contents()); |
| 1056 if (mixed_content_settings) { |
| 1057 mixed_content_settings->AllowRunningOfInsecureContent(); |
| 1058 } |
| 1059 |
1052 web_contents()->SendToAllFrames( | 1060 web_contents()->SendToAllFrames( |
1053 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true)); | 1061 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true)); |
1054 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame( | 1062 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame( |
1055 web_contents()->GetMainFrame()->GetRoutingID())); | 1063 web_contents()->GetMainFrame()->GetRoutingID())); |
1056 | 1064 |
1057 content_settings::RecordMixedScriptAction( | 1065 content_settings::RecordMixedScriptAction( |
1058 content_settings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW); | 1066 content_settings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW); |
1059 | 1067 |
1060 rappor::SampleDomainAndRegistryFromGURL( | 1068 rappor::SampleDomainAndRegistryFromGURL( |
1061 rappor_service(), "ContentSettings.MixedScript.UserClickedAllow", | 1069 rappor_service(), "ContentSettings.MixedScript.UserClickedAllow", |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1456 ContentSettingMediaStreamBubbleModel* | 1464 ContentSettingMediaStreamBubbleModel* |
1457 ContentSettingBubbleModel::AsMediaStreamBubbleModel() { | 1465 ContentSettingBubbleModel::AsMediaStreamBubbleModel() { |
1458 // In general, bubble models might not inherit from the media bubble model. | 1466 // In general, bubble models might not inherit from the media bubble model. |
1459 return nullptr; | 1467 return nullptr; |
1460 } | 1468 } |
1461 | 1469 |
1462 ContentSettingSubresourceFilterBubbleModel* | 1470 ContentSettingSubresourceFilterBubbleModel* |
1463 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { | 1471 ContentSettingBubbleModel::AsSubresourceFilterBubbleModel() { |
1464 return nullptr; | 1472 return nullptr; |
1465 } | 1473 } |
OLD | NEW |