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/macros.h" | 10 #include "base/macros.h" |
11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/chrome_notification_types.h" | 14 #include "chrome/browser/chrome_notification_types.h" |
15 #include "chrome/browser/content_settings/chrome_content_settings_utils.h" | 15 #include "chrome/browser/content_settings/chrome_content_settings_utils.h" |
16 #include "chrome/browser/content_settings/cookie_settings_factory.h" | 16 #include "chrome/browser/content_settings/cookie_settings_factory.h" |
17 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" | 17 #include "chrome/browser/content_settings/host_content_settings_map_factory.h" |
18 #include "chrome/browser/content_settings/mixed_content_settings.h" | |
19 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | |
18 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 20 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
19 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 21 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
20 #include "chrome/browser/infobars/infobar_service.h" | 22 #include "chrome/browser/infobars/infobar_service.h" |
21 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 23 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
22 #include "chrome/browser/permissions/permission_util.h" | 24 #include "chrome/browser/permissions/permission_util.h" |
23 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 25 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
24 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
25 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 27 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
26 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" | 28 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" |
27 #include "chrome/browser/ui/content_settings/content_setting_bubble_model_delega te.h" | 29 #include "chrome/browser/ui/content_settings/content_setting_bubble_model_delega te.h" |
(...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
974 CONTENT_SETTINGS_TYPE_MIXEDSCRIPT) { | 976 CONTENT_SETTINGS_TYPE_MIXEDSCRIPT) { |
975 content_settings::RecordMixedScriptAction( | 977 content_settings::RecordMixedScriptAction( |
976 content_settings::MIXED_SCRIPT_ACTION_DISPLAYED_BUBBLE); | 978 content_settings::MIXED_SCRIPT_ACTION_DISPLAYED_BUBBLE); |
977 set_custom_link_enabled(true); | 979 set_custom_link_enabled(true); |
978 } | 980 } |
979 | 981 |
980 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() { | 982 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() { |
981 if (!web_contents()) | 983 if (!web_contents()) |
982 return; | 984 return; |
983 | 985 |
986 MixedContentSettings* mixed_content_settings = | |
987 MixedContentSettings::FromWebContents(web_contents()); | |
988 mixed_content_settings->AllowRunningOfInsecureContent(); | |
carlosk
2016/07/18 14:37:13
Similarly, should this following code that notifie
| |
984 web_contents()->SendToAllFrames( | 989 web_contents()->SendToAllFrames( |
985 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true)); | 990 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true)); |
986 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame( | 991 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame( |
987 web_contents()->GetMainFrame()->GetRoutingID())); | 992 web_contents()->GetMainFrame()->GetRoutingID())); |
988 | 993 |
989 content_settings::RecordMixedScriptAction( | 994 content_settings::RecordMixedScriptAction( |
990 content_settings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW); | 995 content_settings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW); |
991 | 996 |
992 rappor::SampleDomainAndRegistryFromGURL( | 997 rappor::SampleDomainAndRegistryFromGURL( |
993 g_browser_process->rappor_service(), | 998 g_browser_process->rappor_service(), |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1331 ContentSettingBubbleModel::AsSimpleBubbleModel() { | 1336 ContentSettingBubbleModel::AsSimpleBubbleModel() { |
1332 // In general, bubble models might not inherit from the simple bubble model. | 1337 // In general, bubble models might not inherit from the simple bubble model. |
1333 return nullptr; | 1338 return nullptr; |
1334 } | 1339 } |
1335 | 1340 |
1336 ContentSettingMediaStreamBubbleModel* | 1341 ContentSettingMediaStreamBubbleModel* |
1337 ContentSettingBubbleModel::AsMediaStreamBubbleModel() { | 1342 ContentSettingBubbleModel::AsMediaStreamBubbleModel() { |
1338 // In general, bubble models might not inherit from the media bubble model. | 1343 // In general, bubble models might not inherit from the media bubble model. |
1339 return nullptr; | 1344 return nullptr; |
1340 } | 1345 } |
OLD | NEW |