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