Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(280)

Side by Side Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 659573003: Log mixed script shield events. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/metrics/histogram.h"
8 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
9 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/chrome_notification_types.h" 11 #include "chrome/browser/chrome_notification_types.h"
11 #include "chrome/browser/content_settings/content_settings_utils.h" 12 #include "chrome/browser/content_settings/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/custom_handlers/protocol_handler_registry.h" 14 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
14 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h" 15 #include "chrome/browser/custom_handlers/protocol_handler_registry_factory.h"
15 #include "chrome/browser/favicon/favicon_tab_helper.h" 16 #include "chrome/browser/favicon/favicon_tab_helper.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"
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after
957 }; 958 };
958 959
959 ContentSettingMixedScriptBubbleModel::ContentSettingMixedScriptBubbleModel( 960 ContentSettingMixedScriptBubbleModel::ContentSettingMixedScriptBubbleModel(
960 Delegate* delegate, 961 Delegate* delegate,
961 WebContents* web_contents, 962 WebContents* web_contents,
962 Profile* profile, 963 Profile* profile,
963 ContentSettingsType content_type) 964 ContentSettingsType content_type)
964 : ContentSettingTitleLinkAndCustomModel( 965 : ContentSettingTitleLinkAndCustomModel(
965 delegate, web_contents, profile, content_type) { 966 delegate, web_contents, profile, content_type) {
966 DCHECK_EQ(content_type, CONTENT_SETTINGS_TYPE_MIXEDSCRIPT); 967 DCHECK_EQ(content_type, CONTENT_SETTINGS_TYPE_MIXEDSCRIPT);
968 UMA_HISTOGRAM_ENUMERATION("ContentSettings.MixedScript",
969 TabSpecificContentSettings::MIXEDSCRIPT_DISPLAYED_BUBBLE,
970 TabSpecificContentSettings::MIXEDSCRIPT_CONTENT_NUM_EVENTS);
967 set_custom_link_enabled(true); 971 set_custom_link_enabled(true);
968 } 972 }
969 973
970 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() { 974 void ContentSettingMixedScriptBubbleModel::OnCustomLinkClicked() {
971 content::RecordAction(UserMetricsAction("MixedScript_LoadAnyway_Bubble")); 975 UMA_HISTOGRAM_ENUMERATION("ContentSettings.MixedScript",
976 TabSpecificContentSettings::MIXEDSCRIPT_CLICKED_ALLOW,
977 TabSpecificContentSettings::MIXEDSCRIPT_CONTENT_NUM_EVENTS);
972 DCHECK(web_contents()); 978 DCHECK(web_contents());
973 web_contents()->SendToAllFrames( 979 web_contents()->SendToAllFrames(
974 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true)); 980 new ChromeViewMsg_SetAllowRunningInsecureContent(MSG_ROUTING_NONE, true));
975 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame( 981 web_contents()->GetMainFrame()->Send(new ChromeViewMsg_ReloadFrame(
976 web_contents()->GetMainFrame()->GetRoutingID())); 982 web_contents()->GetMainFrame()->GetRoutingID()));
977 } 983 }
978 984
979 ContentSettingRPHBubbleModel::ContentSettingRPHBubbleModel( 985 ContentSettingRPHBubbleModel::ContentSettingRPHBubbleModel(
980 Delegate* delegate, 986 Delegate* delegate,
981 WebContents* web_contents, 987 WebContents* web_contents,
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
1281 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) { 1287 if (type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED) {
1282 DCHECK_EQ(web_contents_, 1288 DCHECK_EQ(web_contents_,
1283 content::Source<WebContents>(source).ptr()); 1289 content::Source<WebContents>(source).ptr());
1284 web_contents_ = NULL; 1290 web_contents_ = NULL;
1285 } else { 1291 } else {
1286 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type); 1292 DCHECK_EQ(chrome::NOTIFICATION_PROFILE_DESTROYED, type);
1287 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr()); 1293 DCHECK_EQ(profile_, content::Source<Profile>(source).ptr());
1288 profile_ = NULL; 1294 profile_ = NULL;
1289 } 1295 }
1290 } 1296 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698