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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "chrome/browser/browser_process.h" | |
10 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
11 #include "chrome/browser/content_settings/chrome_content_settings_utils.h" | 12 #include "chrome/browser/content_settings/chrome_content_settings_utils.h" |
12 #include "chrome/browser/content_settings/cookie_settings.h" | 13 #include "chrome/browser/content_settings/cookie_settings.h" |
13 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 14 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
14 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 15 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
15 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" | 16 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" |
16 #include "chrome/browser/infobars/infobar_service.h" | 17 #include "chrome/browser/infobars/infobar_service.h" |
17 #include "chrome/browser/media/media_capture_devices_dispatcher.h" | 18 #include "chrome/browser/media/media_capture_devices_dispatcher.h" |
18 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" | 19 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
19 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" | 21 #include "chrome/browser/ui/blocked_content/popup_blocker_tab_helper.h" |
21 #include "chrome/browser/ui/browser_navigator.h" | 22 #include "chrome/browser/ui/browser_navigator.h" |
22 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" | 23 #include "chrome/browser/ui/collected_cookies_infobar_delegate.h" |
23 #include "chrome/browser/ui/content_settings/content_setting_bubble_model_delega te.h" | 24 #include "chrome/browser/ui/content_settings/content_setting_bubble_model_delega te.h" |
24 #include "chrome/common/chrome_switches.h" | 25 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
26 #include "chrome/common/render_messages.h" | 27 #include "chrome/common/render_messages.h" |
27 #include "chrome/grit/generated_resources.h" | 28 #include "chrome/grit/generated_resources.h" |
28 #include "components/content_settings/content/common/content_settings_messages.h " | 29 #include "components/content_settings/content/common/content_settings_messages.h " |
29 #include "components/content_settings/core/browser/content_settings_utils.h" | 30 #include "components/content_settings/core/browser/content_settings_utils.h" |
30 #include "components/content_settings/core/common/content_settings.h" | 31 #include "components/content_settings/core/common/content_settings.h" |
32 #include "components/rappor/rappor_utils.h" | |
31 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
32 #include "content/public/browser/render_frame_host.h" | 34 #include "content/public/browser/render_frame_host.h" |
33 #include "content/public/browser/render_process_host.h" | 35 #include "content/public/browser/render_process_host.h" |
34 #include "content/public/browser/render_view_host.h" | 36 #include "content/public/browser/render_view_host.h" |
35 #include "content/public/browser/user_metrics.h" | 37 #include "content/public/browser/user_metrics.h" |
36 #include "content/public/browser/web_contents.h" | 38 #include "content/public/browser/web_contents.h" |
37 #include "content/public/browser/web_contents_delegate.h" | 39 #include "content/public/browser/web_contents_delegate.h" |
38 #include "content/public/common/origin_util.h" | 40 #include "content/public/common/origin_util.h" |
39 #include "grit/components_strings.h" | 41 #include "grit/components_strings.h" |
40 #include "grit/theme_resources.h" | 42 #include "grit/theme_resources.h" |
(...skipping 955 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
996 } | 998 } |
997 | 999 |
998 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() { | 1000 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() { |
999 content_settings::RecordMixedScriptAction( | 1001 content_settings::RecordMixedScriptAction( |
1000 content_settings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW); | 1002 content_settings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW); |
1001 DCHECK(web_contents()); | 1003 DCHECK(web_contents()); |
1002 web_contents()->SendToAllFrames( | 1004 web_contents()->SendToAllFrames( |
1003 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true)); | 1005 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true)); |
1004 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame( | 1006 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame( |
1005 web_contents()->GetMainFrame()->GetRoutingID())); | 1007 web_contents()->GetMainFrame()->GetRoutingID())); |
1008 | |
1009 // During an interstitial, the shield applies to the last committed URL. | |
felt
2015/05/22 20:59:34
what is this comment here for? to explain why you'
lgarron
2015/06/03 03:19:55
Yeah, exactly. (I would have put the comment below
| |
1010 rappor::SampleDomainAndRegistryFromGURL( | |
1011 g_browser_process->rappor_service(), | |
1012 "ContentSettings.MixedScript.UserClickedAllow", | |
1013 web_contents()->GetLastCommittedURL()); | |
1006 } | 1014 } |
1007 | 1015 |
1008 ContentSettingRPHBubbleModel::ContentSettingRPHBubbleModel( | 1016 ContentSettingRPHBubbleModel::ContentSettingRPHBubbleModel( |
1009 Delegate* delegate, | 1017 Delegate* delegate, |
1010 WebContents* web_contents, | 1018 WebContents* web_contents, |
1011 Profile* profile, | 1019 Profile* profile, |
1012 ProtocolHandlerRegistry* registry) | 1020 ProtocolHandlerRegistry* registry) |
1013 : ContentSettingTitleAndLinkModel(delegate, | 1021 : ContentSettingTitleAndLinkModel(delegate, |
1014 web_contents, | 1022 web_contents, |
1015 profile, | 1023 profile, |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1305 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 1313 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { |
1306 DCHECK_EQ(web_contents_, | 1314 DCHECK_EQ(web_contents_, |
1307 content::Source<WebContents>(source).ptr()); | 1315 content::Source<WebContents>(source).ptr()); |
1308 web_contents_ = NULL; | 1316 web_contents_ = NULL; |
1309 } else { | 1317 } else { |
1310 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); | 1318 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); |
1311 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); | 1319 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); |
1312 profile_ = NULL; | 1320 profile_ = NULL; |
1313 } | 1321 } |
1314 } | 1322 } |
OLD | NEW |