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/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 : ContentSettingTitleLinkAndCustomModel(delegate, | 976 : ContentSettingTitleLinkAndCustomModel(delegate, |
977 web_contents, | 977 web_contents, |
978 profile, | 978 profile, |
979 CONTENT_SETTINGS_TYPE_MIXEDSCRIPT) { | 979 CONTENT_SETTINGS_TYPE_MIXEDSCRIPT) { |
980 content_settings::RecordMixedScriptAction( | 980 content_settings::RecordMixedScriptAction( |
981 content_settings::MIXED_SCRIPT_ACTION_DISPLAYED_BUBBLE); | 981 content_settings::MIXED_SCRIPT_ACTION_DISPLAYED_BUBBLE); |
982 set_custom_link_enabled(true); | 982 set_custom_link_enabled(true); |
983 } | 983 } |
984 | 984 |
985 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() { | 985 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() { |
986 content_settings::RecordMixedScriptAction( | |
987 content_settings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW); | |
988 DCHECK(web_contents()); | 986 DCHECK(web_contents()); |
989 web_contents()->SendToAllFrames( | 987 web_contents()->SendToAllFrames( |
990 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true)); | 988 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true)); |
991 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame( | 989 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame( |
992 web_contents()->GetMainFrame()->GetRoutingID())); | 990 web_contents()->GetMainFrame()->GetRoutingID())); |
| 991 |
| 992 content_settings::RecordMixedScriptAction( |
| 993 content_settings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW); |
| 994 content_settings::RecordMixedScriptActionWithRAPPOR( |
| 995 content_settings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW, |
| 996 web_contents()->GetLastCommittedURL()); |
993 } | 997 } |
994 | 998 |
995 ContentSettingRPHBubbleModel::ContentSettingRPHBubbleModel( | 999 ContentSettingRPHBubbleModel::ContentSettingRPHBubbleModel( |
996 Delegate* delegate, | 1000 Delegate* delegate, |
997 WebContents* web_contents, | 1001 WebContents* web_contents, |
998 Profile* profile, | 1002 Profile* profile, |
999 ProtocolHandlerRegistry* registry) | 1003 ProtocolHandlerRegistry* registry) |
1000 : ContentSettingTitleAndLinkModel(delegate, | 1004 : ContentSettingTitleAndLinkModel(delegate, |
1001 web_contents, | 1005 web_contents, |
1002 profile, | 1006 profile, |
(...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1292 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 1296 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { |
1293 DCHECK_EQ(web_contents_, | 1297 DCHECK_EQ(web_contents_, |
1294 content::Source<WebContents>(source).ptr()); | 1298 content::Source<WebContents>(source).ptr()); |
1295 web_contents_ = NULL; | 1299 web_contents_ = NULL; |
1296 } else { | 1300 } else { |
1297 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); | 1301 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); |
1298 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); | 1302 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); |
1299 profile_ = NULL; | 1303 profile_ = NULL; |
1300 } | 1304 } |
1301 } | 1305 } |
OLD | NEW |