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

Side by Side Diff: chrome/browser/ui/webui/options/content_settings_handler.cc

Issue 8873056: Fix UserActionsMetrics calls for content settings UMA (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/tools/chromeactions.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/webui/options/content_settings_handler.h" 5 #include "chrome/browser/ui/webui/options/content_settings_handler.h"
6 6
7 #include <map> 7 #include <map>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) { 684 if (content_type == CONTENT_SETTINGS_TYPE_NOTIFICATIONS) {
685 Profile* profile = Profile::FromWebUI(web_ui_); 685 Profile* profile = Profile::FromWebUI(web_ui_);
686 DesktopNotificationServiceFactory::GetForProfile(profile)-> 686 DesktopNotificationServiceFactory::GetForProfile(profile)->
687 SetDefaultContentSetting(default_setting); 687 SetDefaultContentSetting(default_setting);
688 } else { 688 } else {
689 GetContentSettingsMap()-> 689 GetContentSettingsMap()->
690 SetDefaultContentSetting(content_type, default_setting); 690 SetDefaultContentSetting(content_type, default_setting);
691 } 691 }
692 switch (content_type) { 692 switch (content_type) {
693 case CONTENT_SETTINGS_TYPE_COOKIES: 693 case CONTENT_SETTINGS_TYPE_COOKIES:
694 UserMetrics::RecordAction(UserMetricsAction( 694 UserMetrics::RecordAction(
695 "ContentSetting_DefaultCookieSettingChanged")); 695 UserMetricsAction("Options_DefaultCookieSettingChanged"));
696 break; 696 break;
697 case CONTENT_SETTINGS_TYPE_IMAGES: 697 case CONTENT_SETTINGS_TYPE_IMAGES:
698 UserMetrics::RecordAction(UserMetricsAction( 698 UserMetrics::RecordAction(
699 "ContentSetting_DefaultImagesSettingChanged")); 699 UserMetricsAction("Options_DefaultImagesSettingChanged"));
700 break; 700 break;
701 case CONTENT_SETTINGS_TYPE_JAVASCRIPT: 701 case CONTENT_SETTINGS_TYPE_JAVASCRIPT:
702 UserMetrics::RecordAction(UserMetricsAction( 702 UserMetrics::RecordAction(
703 "ContentSetting_DefaultJavaScriptSettingChanged")); 703 UserMetricsAction("Options_DefaultJavaScriptSettingChanged"));
704 break; 704 break;
705 case CONTENT_SETTINGS_TYPE_PLUGINS: 705 case CONTENT_SETTINGS_TYPE_PLUGINS:
706 UserMetrics::RecordAction(UserMetricsAction( 706 UserMetrics::RecordAction(
707 "ContentSetting_DefaultPluginsSettingChanged")); 707 UserMetricsAction("Options_DefaultPluginsSettingChanged"));
708 break; 708 break;
709 case CONTENT_SETTINGS_TYPE_POPUPS: 709 case CONTENT_SETTINGS_TYPE_POPUPS:
710 UserMetrics::RecordAction(UserMetricsAction( 710 UserMetrics::RecordAction(
711 "ContentSettings_DefaultPopupsSettingChanged")); 711 UserMetricsAction("Options_DefaultPopupsSettingChanged"));
712 break; 712 break;
713 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: 713 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
714 UserMetrics::RecordAction(UserMetricsAction( 714 UserMetrics::RecordAction(
715 "ContentSettings_DefaultNotificationsSettingChanged")); 715 UserMetricsAction("Options_DefaultNotificationsSettingChanged"));
716 break; 716 break;
717 case CONTENT_SETTINGS_TYPE_GEOLOCATION: 717 case CONTENT_SETTINGS_TYPE_GEOLOCATION:
718 UserMetrics::RecordAction(UserMetricsAction( 718 UserMetrics::RecordAction(
719 "ContentSetting_DefaultGeolocationSettingChanged")); 719 UserMetricsAction("Options_DefaultGeolocationSettingChanged"));
720 break; 720 break;
721 case CONTENT_SETTINGS_TYPE_INTENTS: 721 case CONTENT_SETTINGS_TYPE_INTENTS:
722 UserMetrics::RecordAction(UserMetricsAction( 722 UserMetrics::RecordAction(
723 "ContentSetting_DefaultHandlersSettingChanged")); 723 UserMetricsAction("Options_DefaultHandlersSettingChanged"));
724 break; 724 break;
725 case CONTENT_SETTINGS_TYPE_MOUSELOCK: 725 case CONTENT_SETTINGS_TYPE_MOUSELOCK:
726 UserMetrics::RecordAction(UserMetricsAction( 726 UserMetrics::RecordAction(
727 "ContentSettings_DefaultMouseLockSettingChanged")); 727 UserMetricsAction("Options_DefaultMouseLockSettingChanged"));
728 break; 728 break;
729 default: 729 default:
730 break; 730 break;
731 } 731 }
732 } 732 }
733 733
734 void ContentSettingsHandler::RemoveException(const ListValue* args) { 734 void ContentSettingsHandler::RemoveException(const ListValue* args) {
735 size_t arg_i = 0; 735 size_t arg_i = 0;
736 std::string type_string; 736 std::string type_string;
737 CHECK(args->GetString(arg_i++, &type_string)); 737 CHECK(args->GetString(arg_i++, &type_string));
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
868 return Profile::FromWebUI(web_ui_)->GetProtocolHandlerRegistry(); 868 return Profile::FromWebUI(web_ui_)->GetProtocolHandlerRegistry();
869 } 869 }
870 870
871 HostContentSettingsMap* 871 HostContentSettingsMap*
872 ContentSettingsHandler::GetOTRContentSettingsMap() { 872 ContentSettingsHandler::GetOTRContentSettingsMap() {
873 Profile* profile = Profile::FromWebUI(web_ui_); 873 Profile* profile = Profile::FromWebUI(web_ui_);
874 if (profile->HasOffTheRecordProfile()) 874 if (profile->HasOffTheRecordProfile())
875 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap(); 875 return profile->GetOffTheRecordProfile()->GetHostContentSettingsMap();
876 return NULL; 876 return NULL;
877 } 877 }
OLDNEW
« no previous file with comments | « no previous file | chrome/tools/chromeactions.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698