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

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

Issue 1148773005: Add a RAPPOR metric to track where users click to allow mixed scripts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forward-declare GURL. Created 5 years, 6 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/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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/content_settings/tab_specific_content_settings.cc ('k') | tools/metrics/rappor/rappor.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698