summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/bookmark_bar_gtk.cc3
-rw-r--r--chrome/browser/gtk/bookmark_bubble_gtk.cc17
-rw-r--r--chrome/browser/gtk/options/advanced_contents_gtk.cc75
-rw-r--r--chrome/browser/gtk/options/advanced_page_gtk.cc2
-rw-r--r--chrome/browser/gtk/options/content_page_gtk.cc28
-rw-r--r--chrome/browser/gtk/options/cookie_filter_page_gtk.cc2
-rw-r--r--chrome/browser/gtk/options/general_page_gtk.cc22
-rw-r--r--chrome/browser/gtk/options/languages_page_gtk.cc2
8 files changed, 89 insertions, 62 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc
index fd4a48b..1b675d6 100644
--- a/chrome/browser/gtk/bookmark_bar_gtk.cc
+++ b/chrome/browser/gtk/bookmark_bar_gtk.cc
@@ -996,7 +996,8 @@ void BookmarkBarGtk::OnClicked(GtkWidget* sender) {
gtk_util::DispositionForCurrentButtonPressEvent(),
PageTransition::AUTO_BOOKMARK);
- UserMetrics::RecordAction("ClickedBookmarkBarURLButton", profile_);
+ UserMetrics::RecordAction(UserMetricsAction("ClickedBookmarkBarURLButton"),
+ profile_);
}
void BookmarkBarGtk::OnButtonDragBegin(GtkWidget* button,
diff --git a/chrome/browser/gtk/bookmark_bubble_gtk.cc b/chrome/browser/gtk/bookmark_bubble_gtk.cc
index 3e09a4a..19c7374 100644
--- a/chrome/browser/gtk/bookmark_bubble_gtk.cc
+++ b/chrome/browser/gtk/bookmark_bubble_gtk.cc
@@ -287,7 +287,8 @@ void BookmarkBubbleGtk::OnNameActivate(GtkWidget* widget) {
void BookmarkBubbleGtk::OnFolderChanged(GtkWidget* widget) {
size_t cur_folder = gtk_combo_box_get_active(GTK_COMBO_BOX(folder_combo_));
if (cur_folder == folder_nodes_.size()) {
- UserMetrics::RecordAction("BookmarkBubble_EditFromCombobox", profile_);
+ UserMetrics::RecordAction(
+ UserMetricsAction("BookmarkBubble_EditFromCombobox"), profile_);
// GTK doesn't handle having the combo box destroyed from the changed
// signal. Since showing the editor also closes the bubble, delay this
// so that GTK can unwind. Specifically gtk_menu_shell_button_release
@@ -310,7 +311,8 @@ void BookmarkBubbleGtk::OnFolderPopupShown(GtkWidget* widget,
}
void BookmarkBubbleGtk::OnEditClicked(GtkWidget* widget) {
- UserMetrics::RecordAction("BookmarkBubble_Edit", profile_);
+ UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Edit"),
+ profile_);
ShowEditor();
}
@@ -319,7 +321,8 @@ void BookmarkBubbleGtk::OnCloseClicked(GtkWidget* widget) {
}
void BookmarkBubbleGtk::OnRemoveClicked(GtkWidget* widget) {
- UserMetrics::RecordAction("BookmarkBubble_Unstar", profile_);
+ UserMetrics::RecordAction(UserMetricsAction("BookmarkBubble_Unstar"),
+ profile_);
apply_edits_ = false;
remove_bookmark_ = true;
@@ -340,8 +343,9 @@ void BookmarkBubbleGtk::ApplyEdits() {
if (new_title != node->GetTitle()) {
model->SetTitle(node, new_title);
- UserMetrics::RecordAction("BookmarkBubble_ChangeTitleInBubble",
- profile_);
+ UserMetrics::RecordAction(
+ UserMetricsAction("BookmarkBubble_ChangeTitleInBubble"),
+ profile_);
}
size_t cur_folder = gtk_combo_box_get_active(GTK_COMBO_BOX(folder_combo_));
@@ -350,7 +354,8 @@ void BookmarkBubbleGtk::ApplyEdits() {
if (cur_folder < folder_nodes_.size()) {
const BookmarkNode* new_parent = folder_nodes_[cur_folder];
if (new_parent != node->GetParent()) {
- UserMetrics::RecordAction("BookmarkBubble_ChangeParent", profile_);
+ UserMetrics::RecordAction(
+ UserMetricsAction("BookmarkBubble_ChangeParent"), profile_);
model->Move(node, new_parent, new_parent->GetChildCount());
}
}
diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc
index d585ed5..9a1f01b 100644
--- a/chrome/browser/gtk/options/advanced_contents_gtk.cc
+++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc
@@ -295,8 +295,9 @@ void DownloadSection::OnDownloadLocationChanged(GtkFileChooser* widget,
// metric if something actually changed.
if (path.ToWStringHack() != section->default_download_location_.GetValue()) {
section->default_download_location_.SetValue(path.ToWStringHack());
- section->UserMetricsRecordAction("Options_SetDownloadDirectory",
- section->profile()->GetPrefs());
+ section->UserMetricsRecordAction(
+ UserMetricsAction("Options_SetDownloadDirectory"),
+ section->profile()->GetPrefs());
}
}
@@ -307,11 +308,13 @@ void DownloadSection::OnDownloadAskForSaveLocationChanged(
return;
bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
if (enabled) {
- section->UserMetricsRecordAction("Options_AskForSaveLocation_Enable",
- section->profile()->GetPrefs());
+ section->UserMetricsRecordAction(
+ UserMetricsAction("Options_AskForSaveLocation_Enable"),
+ section->profile()->GetPrefs());
} else {
- section->UserMetricsRecordAction("Options_AskForSaveLocation_Disable",
- section->profile()->GetPrefs());
+ section->UserMetricsRecordAction(
+ UserMetricsAction("Options_AskForSaveLocation_Disable"),
+ section->profile()->GetPrefs());
}
section->ask_for_save_location_.SetValue(enabled);
}
@@ -320,8 +323,9 @@ void DownloadSection::OnDownloadAskForSaveLocationChanged(
void DownloadSection::OnResetFileHandlersClicked(GtkButton *button,
DownloadSection* section) {
section->profile()->GetDownloadManager()->ResetAutoOpenFiles();
- section->UserMetricsRecordAction("Options_ResetAutoOpenFiles",
- section->profile()->GetPrefs());
+ section->UserMetricsRecordAction(
+ UserMetricsAction("Options_ResetAutoOpenFiles"),
+ section->profile()->GetPrefs());
}
///////////////////////////////////////////////////////////////////////////////
@@ -386,7 +390,8 @@ NetworkSection::NetworkSection(Profile* profile)
// static
void NetworkSection::OnChangeProxiesButtonClicked(GtkButton *button,
NetworkSection* section) {
- section->UserMetricsRecordAction("Options_ChangeProxies", NULL);
+ section->UserMetricsRecordAction(UserMetricsAction("Options_ChangeProxies"),
+ NULL);
scoped_ptr<base::EnvironmentVariableGetter> env_getter(
base::EnvironmentVariableGetter::Create());
@@ -547,7 +552,9 @@ void TranslateSection::OnTranslateClicked(GtkWidget* widget) {
return;
bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
UserMetricsRecordAction(
- enabled ? "Options_Translate_Enable" : "Options_Translate_Disable",
+ enabled ?
+ UserMetricsAction("Options_Translate_Enable") :
+ UserMetricsAction("Options_Translate_Disable"),
profile()->GetPrefs());
enable_translate_.SetValue(enabled);
}
@@ -761,8 +768,8 @@ void PrivacySection::OnEnableLinkDoctorChange(GtkWidget* widget,
bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
privacy_section->UserMetricsRecordAction(
enabled ?
- "Options_LinkDoctorCheckbox_Enable" :
- "Options_LinkDoctorCheckbox_Disable",
+ UserMetricsAction("Options_LinkDoctorCheckbox_Enable") :
+ UserMetricsAction("Options_LinkDoctorCheckbox_Disable"),
privacy_section->profile()->GetPrefs());
privacy_section->alternate_error_pages_.SetValue(enabled);
}
@@ -775,8 +782,8 @@ void PrivacySection::OnEnableSuggestChange(GtkWidget* widget,
bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
privacy_section->UserMetricsRecordAction(
enabled ?
- "Options_UseSuggestCheckbox_Enable" :
- "Options_UseSuggestCheckbox_Disable",
+ UserMetricsAction("Options_UseSuggestCheckbox_Enable") :
+ UserMetricsAction("Options_UseSuggestCheckbox_Disable"),
privacy_section->profile()->GetPrefs());
privacy_section->use_suggest_.SetValue(enabled);
}
@@ -789,8 +796,8 @@ void PrivacySection::OnDNSPrefetchingChange(GtkWidget* widget,
bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
privacy_section->UserMetricsRecordAction(
enabled ?
- "Options_DnsPrefetchCheckbox_Enable" :
- "Options_DnsPrefetchCheckbox_Disable",
+ UserMetricsAction("Options_DnsPrefetchCheckbox_Enable") :
+ UserMetricsAction("Options_DnsPrefetchCheckbox_Disable"),
privacy_section->profile()->GetPrefs());
privacy_section->dns_prefetch_enabled_.SetValue(enabled);
chrome_browser_net::EnableDnsPrefetch(enabled);
@@ -804,8 +811,8 @@ void PrivacySection::OnSafeBrowsingChange(GtkWidget* widget,
bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
privacy_section->UserMetricsRecordAction(
enabled ?
- "Options_SafeBrowsingCheckbox_Enable" :
- "Options_SafeBrowsingCheckbox_Disable",
+ UserMetricsAction("Options_SafeBrowsingCheckbox_Enable") :
+ UserMetricsAction("Options_SafeBrowsingCheckbox_Disable"),
privacy_section->profile()->GetPrefs());
privacy_section->safe_browsing_.SetValue(enabled);
SafeBrowsingService* safe_browsing_service =
@@ -822,8 +829,8 @@ void PrivacySection::OnLoggingChange(GtkWidget* widget,
bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
privacy_section->UserMetricsRecordAction(
enabled ?
- "Options_MetricsReportingCheckbox_Enable" :
- "Options_MetricsReportingCheckbox_Disable",
+ UserMetricsAction("Options_MetricsReportingCheckbox_Enable") :
+ UserMetricsAction("Options_MetricsReportingCheckbox_Disable"),
privacy_section->profile()->GetPrefs());
// Prevent us from being called again by ResolveMetricsReportingEnabled
// resetting the checkbox if there was a problem.
@@ -1046,11 +1053,13 @@ void SecuritySection::OnRevCheckingEnabledToggled(GtkToggleButton* togglebutton,
bool enabled = gtk_toggle_button_get_active(togglebutton);
if (enabled) {
- section->UserMetricsRecordAction("Options_CheckCertRevocation_Enable",
- NULL);
+ section->UserMetricsRecordAction(
+ UserMetricsAction("Options_CheckCertRevocation_Enable"),
+ NULL);
} else {
- section->UserMetricsRecordAction("Options_CheckCertRevocation_Disable",
- NULL);
+ section->UserMetricsRecordAction(
+ UserMetricsAction("Options_CheckCertRevocation_Disable"),
+ NULL);
}
section->rev_checking_enabled_.SetValue(enabled);
}
@@ -1063,9 +1072,11 @@ void SecuritySection::OnSSL2EnabledToggled(GtkToggleButton* togglebutton,
bool enabled = gtk_toggle_button_get_active(togglebutton);
if (enabled) {
- section->UserMetricsRecordAction("Options_SSL2_Enable", NULL);
+ section->UserMetricsRecordAction(UserMetricsAction("Options_SSL2_Enable"),
+ NULL);
} else {
- section->UserMetricsRecordAction("Options_SSL2_Disable", NULL);
+ section->UserMetricsRecordAction(UserMetricsAction("Options_SSL2_Disable"),
+ NULL);
}
section->ssl2_enabled_.SetValue(enabled);
}
@@ -1078,9 +1089,11 @@ void SecuritySection::OnSSL3EnabledToggled(GtkToggleButton* togglebutton,
bool enabled = gtk_toggle_button_get_active(togglebutton);
if (enabled) {
- section->UserMetricsRecordAction("Options_SSL3_Enable", NULL);
+ section->UserMetricsRecordAction(UserMetricsAction("Options_SSL3_Enable"),
+ NULL);
} else {
- section->UserMetricsRecordAction("Options_SSL3_Disable", NULL);
+ section->UserMetricsRecordAction(UserMetricsAction("Options_SSL3_Disable"),
+ NULL);
}
section->ssl3_enabled_.SetValue(enabled);
}
@@ -1093,9 +1106,11 @@ void SecuritySection::OnTLS1EnabledToggled(GtkToggleButton* togglebutton,
bool enabled = gtk_toggle_button_get_active(togglebutton);
if (enabled) {
- section->UserMetricsRecordAction("Options_TLS1_Enable", NULL);
+ section->UserMetricsRecordAction(UserMetricsAction("Options_TLS1_Enable"),
+ NULL);
} else {
- section->UserMetricsRecordAction("Options_TLS1_Disable", NULL);
+ section->UserMetricsRecordAction(UserMetricsAction("Options_TLS1_Disable"),
+ NULL);
}
section->tls1_enabled_.SetValue(enabled);
}
diff --git a/chrome/browser/gtk/options/advanced_page_gtk.cc b/chrome/browser/gtk/options/advanced_page_gtk.cc
index c09d27e..8efb338 100644
--- a/chrome/browser/gtk/options/advanced_page_gtk.cc
+++ b/chrome/browser/gtk/options/advanced_page_gtk.cc
@@ -47,7 +47,7 @@ void AdvancedPageGtk::Init() {
}
void AdvancedPageGtk::OnResetToDefaultsClicked(GtkWidget* button) {
- UserMetricsRecordAction("Options_ResetToDefaults", NULL);
+ UserMetricsRecordAction(UserMetricsAction("Options_ResetToDefaults"), NULL);
GtkWidget* dialog_ = gtk_message_dialog_new(
GTK_WINDOW(gtk_widget_get_toplevel(page_)),
static_cast<GtkDialogFlags>(GTK_DIALOG_MODAL),
diff --git a/chrome/browser/gtk/options/content_page_gtk.cc b/chrome/browser/gtk/options/content_page_gtk.cc
index 26951ac..45ccd26 100644
--- a/chrome/browser/gtk/options/content_page_gtk.cc
+++ b/chrome/browser/gtk/options/content_page_gtk.cc
@@ -422,17 +422,20 @@ void ContentPageGtk::OnImportButtonClicked(GtkWidget* widget) {
}
void ContentPageGtk::OnGtkThemeButtonClicked(GtkWidget* widget) {
- UserMetricsRecordAction("Options_GtkThemeSet", profile()->GetPrefs());
+ UserMetricsRecordAction(UserMetricsAction("Options_GtkThemeSet"),
+ profile()->GetPrefs());
profile()->SetNativeTheme();
}
void ContentPageGtk::OnResetDefaultThemeButtonClicked(GtkWidget* widget) {
- UserMetricsRecordAction("Options_ThemesReset", profile()->GetPrefs());
+ UserMetricsRecordAction(UserMetricsAction("Options_ThemesReset"),
+ profile()->GetPrefs());
profile()->ClearTheme();
}
void ContentPageGtk::OnGetThemesButtonClicked(GtkWidget* widget) {
- UserMetricsRecordAction("Options_ThemesGallery", profile()->GetPrefs());
+ UserMetricsRecordAction(UserMetricsAction("Options_ThemesGallery"),
+ profile()->GetPrefs());
BrowserList::GetLastActive()->OpenThemeGalleryTabAndActivate();
}
@@ -450,10 +453,10 @@ void ContentPageGtk::OnSystemTitleBarRadioToggled(GtkWidget* widget) {
bool use_custom = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(system_title_bar_hide_radio_));
if (use_custom) {
- UserMetricsRecordAction("Options_CustomFrame_Enable",
+ UserMetricsRecordAction(UserMetricsAction("Options_CustomFrame_Enable"),
profile()->GetPrefs());
} else {
- UserMetricsRecordAction("Options_CustomFrame_Disable",
+ UserMetricsRecordAction(UserMetricsAction("Options_CustomFrame_Disable"),
profile()->GetPrefs());
}
@@ -477,11 +480,12 @@ void ContentPageGtk::OnPasswordRadioToggled(GtkWidget* widget) {
bool enabled = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(passwords_asktosave_radio_));
if (enabled) {
- UserMetricsRecordAction("Options_PasswordManager_Enable",
- profile()->GetPrefs());
- } else {
- UserMetricsRecordAction("Options_PasswordManager_Disable",
+ UserMetricsRecordAction(UserMetricsAction("Options_PasswordManager_Enable"),
profile()->GetPrefs());
+ } else {
+ UserMetricsRecordAction(
+ UserMetricsAction("Options_PasswordManager_Disable"),
+ profile()->GetPrefs());
}
ask_to_save_passwords_.SetValue(enabled);
}
@@ -499,11 +503,11 @@ void ContentPageGtk::OnAutoFillRadioToggled(GtkWidget* widget) {
bool enabled = gtk_toggle_button_get_active(
GTK_TOGGLE_BUTTON(form_autofill_enable_radio_));
if (enabled) {
- UserMetricsRecordAction("Options_FormAutofill_Enable",
- profile()->GetPrefs());
+ UserMetricsRecordAction(UserMetricsAction("Options_FormAutofill_Enable"),
+ profile()->GetPrefs());
gtk_widget_set_sensitive(autofill_button_, TRUE);
} else {
- UserMetricsRecordAction("Options_FormAutofill_Disable",
+ UserMetricsRecordAction(UserMetricsAction("Options_FormAutofill_Disable"),
profile()->GetPrefs());
gtk_widget_set_sensitive(autofill_button_, FALSE);
}
diff --git a/chrome/browser/gtk/options/cookie_filter_page_gtk.cc b/chrome/browser/gtk/options/cookie_filter_page_gtk.cc
index 512dd22..726c1f3 100644
--- a/chrome/browser/gtk/options/cookie_filter_page_gtk.cc
+++ b/chrome/browser/gtk/options/cookie_filter_page_gtk.cc
@@ -192,7 +192,7 @@ void CookieFilterPageGtk::OnClearOnCloseToggled(GtkWidget* toggle_button) {
}
void CookieFilterPageGtk::OnShowCookiesClicked(GtkWidget* button) {
- UserMetricsRecordAction("Options_ShowCookies", NULL);
+ UserMetricsRecordAction(UserMetricsAction("Options_ShowCookies"), NULL);
CookiesView::Show(GTK_WINDOW(gtk_widget_get_toplevel(button)),
profile(),
new BrowsingDataDatabaseHelper(
diff --git a/chrome/browser/gtk/options/general_page_gtk.cc b/chrome/browser/gtk/options/general_page_gtk.cc
index 15db49f..3aaba5c 100644
--- a/chrome/browser/gtk/options/general_page_gtk.cc
+++ b/chrome/browser/gtk/options/general_page_gtk.cc
@@ -394,13 +394,13 @@ void GeneralPageGtk::OnStartupRadioToggled(GtkWidget* toggle_button) {
}
SaveStartupPref();
if (toggle_button == startup_homepage_radio_) {
- UserMetricsRecordAction("Options_Startup_Homepage",
+ UserMetricsRecordAction(UserMetricsAction("Options_Startup_Homepage"),
profile()->GetPrefs());
} else if (toggle_button == startup_last_session_radio_) {
- UserMetricsRecordAction("Options_Startup_LastSession",
+ UserMetricsRecordAction(UserMetricsAction("Options_Startup_LastSession"),
profile()->GetPrefs());
} else if (toggle_button == startup_custom_radio_) {
- UserMetricsRecordAction("Options_Startup_Custom",
+ UserMetricsRecordAction(UserMetricsAction("Options_Startup_Custom"),
profile()->GetPrefs());
}
}
@@ -435,12 +435,12 @@ void GeneralPageGtk::OnNewTabIsHomePageToggled(GtkWidget* toggle_button) {
}
if (toggle_button == homepage_use_newtab_radio_) {
SetHomepage(GURL());
- UserMetricsRecordAction("Options_Homepage_UseNewTab",
+ UserMetricsRecordAction(UserMetricsAction("Options_Homepage_UseNewTab"),
profile()->GetPrefs());
gtk_widget_set_sensitive(homepage_use_url_entry_, FALSE);
} else if (toggle_button == homepage_use_url_radio_) {
SetHomepageFromEntry();
- UserMetricsRecordAction("Options_Homepage_UseURL",
+ UserMetricsRecordAction(UserMetricsAction("Options_Homepage_UseURL"),
profile()->GetPrefs());
gtk_widget_set_sensitive(homepage_use_url_entry_, TRUE);
}
@@ -458,11 +458,13 @@ void GeneralPageGtk::OnShowHomeButtonToggled(GtkWidget* toggle_button) {
bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(toggle_button));
show_home_button_.SetValue(enabled);
if (enabled) {
- UserMetricsRecordAction("Options_Homepage_ShowHomeButton",
- profile()->GetPrefs());
+ UserMetricsRecordAction(
+ UserMetricsAction("Options_Homepage_ShowHomeButton"),
+ profile()->GetPrefs());
} else {
- UserMetricsRecordAction("Options_Homepage_HideHomeButton",
- profile()->GetPrefs());
+ UserMetricsRecordAction(
+ UserMetricsAction("Options_Homepage_HideHomeButton"),
+ profile()->GetPrefs());
}
}
@@ -481,7 +483,7 @@ void GeneralPageGtk::OnBrowserUseAsDefaultClicked(GtkWidget* button) {
// If the user made Chrome the default browser, then he/she arguably wants
// to be notified when that changes.
profile()->GetPrefs()->SetBoolean(prefs::kCheckDefaultBrowser, true);
- UserMetricsRecordAction("Options_SetAsDefaultBrowser",
+ UserMetricsRecordAction(UserMetricsAction("Options_SetAsDefaultBrowser"),
profile()->GetPrefs());
}
diff --git a/chrome/browser/gtk/options/languages_page_gtk.cc b/chrome/browser/gtk/options/languages_page_gtk.cc
index 543538f..506c263 100644
--- a/chrome/browser/gtk/options/languages_page_gtk.cc
+++ b/chrome/browser/gtk/options/languages_page_gtk.cc
@@ -453,7 +453,7 @@ void LanguagesPageGtk::OnDictionaryLanguageChanged(GtkWidget* widget) {
spellcheck_language_added_ = "";
}
- UserMetricsRecordAction("Options_DictionaryLanguage",
+ UserMetricsRecordAction(UserMetricsAction("Options_DictionaryLanguage"),
profile()->GetPrefs());
dictionary_language_.SetValue(ASCIIToWide(language));
}