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 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 }; | 957 }; |
958 | 958 |
959 ContentSettingMixedScriptBubbleModel::ContentSettingMixedScriptBubbleModel( | 959 ContentSettingMixedScriptBubbleModel::ContentSettingMixedScriptBubbleModel( |
960 Delegate* delegate, | 960 Delegate* delegate, |
961 WebContents* web_contents, | 961 WebContents* web_contents, |
962 Profile* profile, | 962 Profile* profile, |
963 ContentSettingsType content_type) | 963 ContentSettingsType content_type) |
964 : ContentSettingTitleLinkAndCustomModel( | 964 : ContentSettingTitleLinkAndCustomModel( |
965 delegate, web_contents, profile, content_type) { | 965 delegate, web_contents, profile, content_type) { |
966 DCHECK_EQ(content_type, CONTENT_SETTINGS_TYPE_MIXEDSCRIPT); | 966 DCHECK_EQ(content_type, CONTENT_SETTINGS_TYPE_MIXEDSCRIPT); |
| 967 TabSpecificContentSettings::RecordMixedScriptAction( |
| 968 TabSpecificContentSettings::MIXED_SCRIPT_ACTION_DISPLAYED_BUBBLE); |
967 set_custom_link_enabled(true); | 969 set_custom_link_enabled(true); |
968 } | 970 } |
969 | 971 |
970 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() { | 972 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() { |
971 content::RecordAction(UserMetricsAction("MixedScript_LoadAnyway_Bubble")); | 973 TabSpecificContentSettings::RecordMixedScriptAction( |
| 974 TabSpecificContentSettings::MIXED_SCRIPT_ACTION_CLICKED_ALLOW); |
972 DCHECK(web_contents()); | 975 DCHECK(web_contents()); |
973 web_contents()->SendToAllFrames( | 976 web_contents()->SendToAllFrames( |
974 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true)); | 977 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true)); |
975 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame( | 978 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame( |
976 web_contents()->GetMainFrame()->GetRoutingID())); | 979 web_contents()->GetMainFrame()->GetRoutingID())); |
977 } | 980 } |
978 | 981 |
979 ContentSettingRPHBubbleModel::ContentSettingRPHBubbleModel( | 982 ContentSettingRPHBubbleModel::ContentSettingRPHBubbleModel( |
980 Delegate* delegate, | 983 Delegate* delegate, |
981 WebContents* web_contents, | 984 WebContents* web_contents, |
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { | 1284 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { |
1282 DCHECK_EQ(web_contents_, | 1285 DCHECK_EQ(web_contents_, |
1283 content::Source<WebContents>(source).ptr()); | 1286 content::Source<WebContents>(source).ptr()); |
1284 web_contents_ = NULL; | 1287 web_contents_ = NULL; |
1285 } else { | 1288 } else { |
1286 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); | 1289 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); |
1287 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); | 1290 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); |
1288 profile_ = NULL; | 1291 profile_ = NULL; |
1289 } | 1292 } |
1290 } | 1293 } |
OLD | NEW |