diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-17 19:04:12 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-17 19:04:12 +0000 |
commit | afe3a16739185a648a21a34e07f3cdb5f1a23c2f (patch) | |
tree | 4c82ce550948ed3d67a7a46a1aa066c9080412fb /chrome/browser | |
parent | d699e3a52d6431ea5d2a691f77866ac8ec7ba350 (diff) | |
download | chromium_src-afe3a16739185a648a21a34e07f3cdb5f1a23c2f.zip chromium_src-afe3a16739185a648a21a34e07f3cdb5f1a23c2f.tar.gz chromium_src-afe3a16739185a648a21a34e07f3cdb5f1a23c2f.tar.bz2 |
Use plain strings instead of wstrings for UMA actions
git grep 'RecordAction(L' | xargs sed -i -e s/RecordAction(L/RecordAction(/
This cuts more than 10k off my binary. Which is nothing compared
to the size of the binary, but that's a whole lot of zero bytes!
This is less code this way anyway.
Review URL: http://codereview.chromium.org/399026
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32194 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
56 files changed, 349 insertions, 348 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc index 218fdd5..46873ba 100644 --- a/chrome/browser/autocomplete/autocomplete_edit.cc +++ b/chrome/browser/autocomplete/autocomplete_edit.cc @@ -261,7 +261,7 @@ void AutocompleteEditModel::SendOpenNotification(size_t selected_line, const TemplateURL* const template_url = template_url_model->GetTemplateURLForKeyword(keyword); if (template_url) { - UserMetrics::RecordAction(L"AcceptedKeyword", profile_); + UserMetrics::RecordAction("AcceptedKeyword", profile_); template_url_model->IncrementUsageCount(template_url); } @@ -279,7 +279,7 @@ void AutocompleteEditModel::AcceptKeyword() { // since the edit contents have disappeared. It // doesn't really matter, but we clear it to be // consistent. - UserMetrics::RecordAction(L"AcceptedKeywordHint", profile_); + UserMetrics::RecordAction("AcceptedKeywordHint", profile_); } void AutocompleteEditModel::ClearKeyword(const std::wstring& visible_text) { diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc index 00cd12c..d30a8af 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc @@ -2325,10 +2325,10 @@ void AutocompleteEditViewWin::StartDragIfNecessary(const CPoint& point) { drag_utils::SetURLAndDragImage(url, title, favicon, &data); data.SetURL(url, title); supported_modes |= DROPEFFECT_LINK; - UserMetrics::RecordAction(L"Omnibox_DragURL", model_->profile()); + UserMetrics::RecordAction("Omnibox_DragURL", model_->profile()); } else { supported_modes |= DROPEFFECT_MOVE; - UserMetrics::RecordAction(L"Omnibox_DragString", model_->profile()); + UserMetrics::RecordAction("Omnibox_DragString", model_->profile()); } data.SetString(GetSelectedText()); diff --git a/chrome/browser/back_forward_menu_model.cc b/chrome/browser/back_forward_menu_model.cc index e7b6d68..43f4b31 100644 --- a/chrome/browser/back_forward_menu_model.cc +++ b/chrome/browser/back_forward_menu_model.cc @@ -164,7 +164,7 @@ void BackForwardMenuModel::ExecuteCommandById(int menu_id) { // Execute the command for the last item: "Show Full History". if (menu_id == GetTotalItemCount()) { - UserMetrics::RecordComputedAction(BuildActionName(L"ShowFullHistory", -1), + UserMetrics::RecordComputedAction(BuildActionName("ShowFullHistory", -1), controller.profile()); browser_->ShowSingleDOMUITab(GURL(chrome::kChromeUIHistoryURL)); return; @@ -173,10 +173,10 @@ void BackForwardMenuModel::ExecuteCommandById(int menu_id) { // Log whether it was a history or chapter click. if (menu_id <= GetHistoryItemCount()) { UserMetrics::RecordComputedAction( - BuildActionName(L"HistoryClick", menu_id), controller.profile()); + BuildActionName("HistoryClick", menu_id), controller.profile()); } else { UserMetrics::RecordComputedAction( - BuildActionName(L"ChapterClick", menu_id - GetHistoryItemCount() - 1), + BuildActionName("ChapterClick", menu_id - GetHistoryItemCount() - 1), controller.profile()); } @@ -284,17 +284,17 @@ NavigationEntry* BackForwardMenuModel::GetNavigationEntry(int menu_id) const { return GetTabContents()->controller().GetEntryAtIndex(index); } -std::wstring BackForwardMenuModel::BuildActionName( - const std::wstring& action, int index) const { +std::string BackForwardMenuModel::BuildActionName( + const std::string& action, int index) const { DCHECK(!action.empty()); DCHECK(index >= -1); - std::wstring metric_string; + std::string metric_string; if (model_type_ == FORWARD_MENU) - metric_string += L"ForwardMenu_"; + metric_string += "ForwardMenu_"; else - metric_string += L"BackMenu_"; + metric_string += "BackMenu_"; metric_string += action; if (index != -1) - metric_string += IntToWString(index); + metric_string += IntToString(index); return metric_string; } diff --git a/chrome/browser/back_forward_menu_model.h b/chrome/browser/back_forward_menu_model.h index acbcdaf..6d0cdb6 100644 --- a/chrome/browser/back_forward_menu_model.h +++ b/chrome/browser/back_forward_menu_model.h @@ -140,7 +140,7 @@ class BackForwardMenuModel { // identifier for logging user behavior. // E.g. BuildActionName("Click", 2) returns "BackMenu_Click2". // An index of -1 means no index. - std::wstring BuildActionName(const std::wstring& name, int index) const; + std::string BuildActionName(const std::string& name, int index) const; Browser* browser_; diff --git a/chrome/browser/back_forward_menu_model_views.cc b/chrome/browser/back_forward_menu_model_views.cc index d689fc7..f9719c4 100644 --- a/chrome/browser/back_forward_menu_model_views.cc +++ b/chrome/browser/back_forward_menu_model_views.cc @@ -93,6 +93,6 @@ void BackForwardMenuModelViews::ActivatedAt(int index) { } void BackForwardMenuModelViews::MenuWillShow() { - UserMetrics::RecordComputedAction(BuildActionName(L"Popup", -1), + UserMetrics::RecordComputedAction(BuildActionName("Popup", -1), browser_->profile()); } diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc index 0e62277..ed7784b 100644 --- a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc +++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc @@ -285,16 +285,16 @@ void BookmarkContextMenuController::ExecuteCommand(int id) { WindowOpenDisposition initial_disposition; if (id == IDS_BOOMARK_BAR_OPEN_ALL) { initial_disposition = NEW_FOREGROUND_TAB; - UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_OpenAll", + UserMetrics::RecordAction("BookmarkBar_ContextMenu_OpenAll", profile_); } else if (id == IDS_BOOMARK_BAR_OPEN_ALL_NEW_WINDOW) { initial_disposition = NEW_WINDOW; - UserMetrics::RecordAction( - L"BookmarkBar_ContextMenu_OpenAllInNewWindow", profile_); + UserMetrics::RecordAction("BookmarkBar_ContextMenu_OpenAllInNewWindow", + profile_); } else { initial_disposition = OFF_THE_RECORD; - UserMetrics::RecordAction( - L"BookmarkBar_ContextMenu_OpenAllIncognito", profile_); + UserMetrics::RecordAction("BookmarkBar_ContextMenu_OpenAllIncognito", + profile_); } bookmark_utils::OpenAll(parent_window_, profile_, navigator_, selection_, initial_disposition); @@ -303,7 +303,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) { case IDS_BOOKMARK_BAR_RENAME_FOLDER: case IDS_BOOKMARK_BAR_EDIT: - UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_Edit", profile_); + UserMetrics::RecordAction("BookmarkBar_ContextMenu_Edit", profile_); if (selection_.size() != 1) { NOTREACHED(); @@ -326,7 +326,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) { break; case IDS_BOOKMARK_BAR_REMOVE: { - UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_Remove", profile_); + UserMetrics::RecordAction("BookmarkBar_ContextMenu_Remove", profile_); BookmarkModel* model = RemoveModelObserver(); for (size_t i = 0; i < selection_.size(); ++i) { @@ -338,7 +338,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) { } case IDS_BOOMARK_BAR_ADD_NEW_BOOKMARK: { - UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_Add", profile_); + UserMetrics::RecordAction("BookmarkBar_ContextMenu_Add", profile_); BookmarkEditor::Configuration editor_config; BookmarkEditor::Handler* handler = NULL; @@ -356,7 +356,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) { } case IDS_BOOMARK_BAR_NEW_FOLDER: { - UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_NewFolder", + UserMetrics::RecordAction("BookmarkBar_ContextMenu_NewFolder", profile_); EditFolderController::Show(profile_, parent_window_, GetParentForNewNodes(), true, @@ -369,7 +369,7 @@ void BookmarkContextMenuController::ExecuteCommand(int id) { break; case IDS_BOOKMARK_MANAGER_SHOW_IN_FOLDER: - UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_ShowInFolder", + UserMetrics::RecordAction("BookmarkBar_ContextMenu_ShowInFolder", profile_); if (selection_.size() != 1) { @@ -381,12 +381,12 @@ void BookmarkContextMenuController::ExecuteCommand(int id) { break; case IDS_BOOKMARK_MANAGER: - UserMetrics::RecordAction(L"ShowBookmarkManager", profile_); + UserMetrics::RecordAction("ShowBookmarkManager", profile_); BookmarkManager::Show(profile_); break; case IDS_BOOKMARK_MANAGER_SORT: - UserMetrics::RecordAction(L"BookmarkManager_Sort", profile_); + UserMetrics::RecordAction("BookmarkManager_Sort", profile_); model_->SortChildren(parent_); break; diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 452b127..4506423 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -701,7 +701,7 @@ void Browser::UpdateCommandsForFullscreenMode(bool is_fullscreen) { // Browser, Assorted browser commands: void Browser::GoBack(WindowOpenDisposition disposition) { - UserMetrics::RecordAction(L"Back", profile_); + UserMetrics::RecordAction("Back", profile_); // If we are showing an interstitial, just hide it. TabContents* current_tab = GetSelectedTabContents(); @@ -734,7 +734,7 @@ void Browser::GoBack(WindowOpenDisposition disposition) { void Browser::GoForward(WindowOpenDisposition disp) { // TODO(brettw) this is mostly duplicated from GoBack, these should have a // common backend or something. - UserMetrics::RecordAction(L"Forward", profile_); + UserMetrics::RecordAction("Forward", profile_); if (GetSelectedTabContents()->controller().CanGoForward()) { NavigationController* controller = 0; if (disp == NEW_FOREGROUND_TAB || disp == NEW_BACKGROUND_TAB) { @@ -752,7 +752,7 @@ void Browser::GoForward(WindowOpenDisposition disp) { } void Browser::Reload() { - UserMetrics::RecordAction(L"Reload", profile_); + UserMetrics::RecordAction("Reload", profile_); // If we are showing an interstitial, treat this as an OpenURL. TabContents* current_tab = GetSelectedTabContents(); @@ -772,12 +772,12 @@ void Browser::Reload() { } void Browser::Home(WindowOpenDisposition disposition) { - UserMetrics::RecordAction(L"Home", profile_); + UserMetrics::RecordAction("Home", profile_); OpenURL(GetHomePage(), GURL(), disposition, PageTransition::AUTO_BOOKMARK); } void Browser::OpenCurrentURL() { - UserMetrics::RecordAction(L"LoadURL", profile_); + UserMetrics::RecordAction("LoadURL", profile_); LocationBar* location_bar = window_->GetLocationBar(); WindowOpenDisposition open_disposition = location_bar->GetWindowOpenDisposition(); @@ -799,22 +799,22 @@ void Browser::OpenCurrentURL() { } void Browser::Go(WindowOpenDisposition disposition) { - UserMetrics::RecordAction(L"Go", profile_); + UserMetrics::RecordAction("Go", profile_); window_->GetLocationBar()->AcceptInputWithDisposition(disposition); } void Browser::Stop() { - UserMetrics::RecordAction(L"Stop", profile_); + UserMetrics::RecordAction("Stop", profile_); GetSelectedTabContents()->Stop(); } void Browser::NewWindow() { - UserMetrics::RecordAction(L"NewWindow", profile_); + UserMetrics::RecordAction("NewWindow", profile_); Browser::OpenEmptyWindow(profile_->GetOriginalProfile()); } void Browser::NewIncognitoWindow() { - UserMetrics::RecordAction(L"NewIncognitoWindow", profile_); + UserMetrics::RecordAction("NewIncognitoWindow", profile_); Browser::OpenEmptyWindow(profile_->GetOffTheRecordProfile()); } @@ -823,18 +823,18 @@ void Browser::NewProfileWindowByIndex(int index) { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) return; - UserMetrics::RecordAction(L"NewProfileWindowByIndex", profile_); + UserMetrics::RecordAction("NewProfileWindowByIndex", profile_); UserDataManager::Get()->LaunchChromeForProfile(index); #endif } void Browser::CloseWindow() { - UserMetrics::RecordAction(L"CloseWindow", profile_); + UserMetrics::RecordAction("CloseWindow", profile_); window_->Close(); } void Browser::NewTab() { - UserMetrics::RecordAction(L"NewTab", profile_); + UserMetrics::RecordAction("NewTab", profile_); if (type() == TYPE_NORMAL) { AddBlankTab(true); } else { @@ -849,49 +849,49 @@ void Browser::NewTab() { } void Browser::CloseTab() { - UserMetrics::RecordAction(L"CloseTab_Accelerator", profile_); + UserMetrics::RecordAction("CloseTab_Accelerator", profile_); tabstrip_model_.CloseTabContentsAt(tabstrip_model_.selected_index()); } void Browser::SelectNextTab() { - UserMetrics::RecordAction(L"SelectNextTab", profile_); + UserMetrics::RecordAction("SelectNextTab", profile_); tabstrip_model_.SelectNextTab(); } void Browser::SelectPreviousTab() { - UserMetrics::RecordAction(L"SelectPrevTab", profile_); + UserMetrics::RecordAction("SelectPrevTab", profile_); tabstrip_model_.SelectPreviousTab(); } void Browser::MoveTabNext() { - UserMetrics::RecordAction(L"MoveTabNext", profile_); + UserMetrics::RecordAction("MoveTabNext", profile_); tabstrip_model_.MoveTabNext(); } void Browser::MoveTabPrevious() { - UserMetrics::RecordAction(L"MoveTabPrevious", profile_); + UserMetrics::RecordAction("MoveTabPrevious", profile_); tabstrip_model_.MoveTabPrevious(); } void Browser::SelectNumberedTab(int index) { if (index < tab_count()) { - UserMetrics::RecordAction(L"SelectNumberedTab", profile_); + UserMetrics::RecordAction("SelectNumberedTab", profile_); tabstrip_model_.SelectTabContentsAt(index, true); } } void Browser::SelectLastTab() { - UserMetrics::RecordAction(L"SelectLastTab", profile_); + UserMetrics::RecordAction("SelectLastTab", profile_); tabstrip_model_.SelectLastTab(); } void Browser::DuplicateTab() { - UserMetrics::RecordAction(L"Duplicate", profile_); + UserMetrics::RecordAction("Duplicate", profile_); DuplicateContentsAt(selected_index()); } void Browser::RestoreTab() { - UserMetrics::RecordAction(L"RestoreTab", profile_); + UserMetrics::RecordAction("RestoreTab", profile_); TabRestoreService* service = profile_->GetTabRestoreService(); if (!service) return; @@ -903,7 +903,7 @@ void Browser::WriteCurrentURLToClipboard() { // TODO(ericu): There isn't currently a metric for this. Should there be? // We don't appear to track the action when it comes from the // RenderContextViewMenu. - // UserMetrics::RecordAction(L"$Metric_Name_Goes_Here$", profile_); + // UserMetrics::RecordAction("$Metric_Name_Goes_Here$", profile_); TabContents* contents = GetSelectedTabContents(); if (!contents->ShouldDisplayURL()) @@ -916,7 +916,7 @@ void Browser::WriteCurrentURLToClipboard() { } void Browser::ConvertPopupToTabbedBrowser() { - UserMetrics::RecordAction(L"ShowAsTab", profile_); + UserMetrics::RecordAction("ShowAsTab", profile_); int tab_strip_index = tabstrip_model_.selected_index(); TabContents* contents = tabstrip_model_.DetachTabContentsAt(tab_strip_index); Browser* browser = Browser::Create(profile_); @@ -933,7 +933,7 @@ void Browser::ToggleFullscreenMode() { return; #endif - UserMetrics::RecordAction(L"ToggleFullscreen", profile_); + UserMetrics::RecordAction("ToggleFullscreen", profile_); window_->SetFullscreen(!window_->IsFullscreen()); // On Linux, setting fullscreen mode is an async call to the X server, which // may or may not support fullscreen mode. @@ -944,18 +944,18 @@ void Browser::ToggleFullscreenMode() { #if defined(TOOLKIT_VIEWS) void Browser::ToggleCompactNavigationBar() { - UserMetrics::RecordAction(L"ToggleCompactNavigationBar", profile_); + UserMetrics::RecordAction("ToggleCompactNavigationBar", profile_); window_->ToggleCompactNavigationBar(); } #endif void Browser::Exit() { - UserMetrics::RecordAction(L"Exit", profile_); + UserMetrics::RecordAction("Exit", profile_); BrowserList::CloseAllBrowsersAndExit(); } void Browser::BookmarkCurrentPage() { - UserMetrics::RecordAction(L"Star", profile_); + UserMetrics::RecordAction("Star", profile_); BookmarkModel* model = profile()->GetBookmarkModel(); if (!model || !model->IsLoaded()) @@ -977,12 +977,12 @@ void Browser::BookmarkCurrentPage() { } void Browser::SavePage() { - UserMetrics::RecordAction(L"SavePage", profile_); + UserMetrics::RecordAction("SavePage", profile_); GetSelectedTabContents()->OnSavePage(); } void Browser::ViewSource() { - UserMetrics::RecordAction(L"ViewSource", profile_); + UserMetrics::RecordAction("ViewSource", profile_); TabContents* current_tab = GetSelectedTabContents(); NavigationEntry* entry = current_tab->controller().GetLastCommittedEntry(); @@ -1015,18 +1015,18 @@ bool Browser::SupportsWindowFeature(WindowFeature feature) const { #if defined(OS_WIN) void Browser::ClosePopups() { - UserMetrics::RecordAction(L"CloseAllSuppressedPopups", profile_); + UserMetrics::RecordAction("CloseAllSuppressedPopups", profile_); GetSelectedTabContents()->CloseAllSuppressedPopups(); } #endif void Browser::Print() { - UserMetrics::RecordAction(L"PrintPreview", profile_); + UserMetrics::RecordAction("PrintPreview", profile_); GetSelectedTabContents()->PrintPreview(); } void Browser::ToggleEncodingAutoDetect() { - UserMetrics::RecordAction(L"AutoDetectChange", profile_); + UserMetrics::RecordAction("AutoDetectChange", profile_); encoding_auto_detect_.SetValue(!encoding_auto_detect_.GetValue()); // If "auto detect" is turned on, then any current override encoding // is cleared. This also implicitly performs a reload. @@ -1040,7 +1040,7 @@ void Browser::ToggleEncodingAutoDetect() { } void Browser::OverrideEncoding(int encoding_id) { - UserMetrics::RecordAction(L"OverrideEncoding", profile_); + UserMetrics::RecordAction("OverrideEncoding", profile_); const std::string selected_encoding = CharacterEncoding::GetCanonicalEncodingNameByCommandId(encoding_id); TabContents* contents = GetSelectedTabContents(); @@ -1068,72 +1068,72 @@ void Browser::OverrideEncoding(int encoding_id) { // manager to do that. void Browser::Cut() { - UserMetrics::RecordAction(L"Cut", profile_); + UserMetrics::RecordAction("Cut", profile_); ui_controls::SendKeyPress(window()->GetNativeHandle(), base::VKEY_X, true, false, false); } void Browser::Copy() { - UserMetrics::RecordAction(L"Copy", profile_); + UserMetrics::RecordAction("Copy", profile_); ui_controls::SendKeyPress(window()->GetNativeHandle(), base::VKEY_C, true, false, false); } void Browser::Paste() { - UserMetrics::RecordAction(L"Paste", profile_); + UserMetrics::RecordAction("Paste", profile_); ui_controls::SendKeyPress(window()->GetNativeHandle(), base::VKEY_V, true, false, false); } #endif // #if defined(OS_WIN) void Browser::Find() { - UserMetrics::RecordAction(L"Find", profile_); + UserMetrics::RecordAction("Find", profile_); FindInPage(false, false); } void Browser::FindNext() { - UserMetrics::RecordAction(L"FindNext", profile_); + UserMetrics::RecordAction("FindNext", profile_); FindInPage(true, true); } void Browser::FindPrevious() { - UserMetrics::RecordAction(L"FindPrevious", profile_); + UserMetrics::RecordAction("FindPrevious", profile_); FindInPage(true, false); } void Browser::ZoomIn() { - UserMetrics::RecordAction(L"ZoomPlus", profile_); + UserMetrics::RecordAction("ZoomPlus", profile_); GetSelectedTabContents()->render_view_host()->Zoom(PageZoom::LARGER); } void Browser::ZoomReset() { - UserMetrics::RecordAction(L"ZoomNormal", profile_); + UserMetrics::RecordAction("ZoomNormal", profile_); GetSelectedTabContents()->render_view_host()->Zoom(PageZoom::STANDARD); } void Browser::ZoomOut() { - UserMetrics::RecordAction(L"ZoomMinus", profile_); + UserMetrics::RecordAction("ZoomMinus", profile_); GetSelectedTabContents()->render_view_host()->Zoom(PageZoom::SMALLER); } void Browser::FocusToolbar() { - UserMetrics::RecordAction(L"FocusToolbar", profile_); + UserMetrics::RecordAction("FocusToolbar", profile_); window_->FocusToolbar(); } void Browser::FocusLocationBar() { - UserMetrics::RecordAction(L"FocusLocation", profile_); + UserMetrics::RecordAction("FocusLocation", profile_); window_->SetFocusToLocationBar(); } void Browser::FocusSearch() { // TODO(beng): replace this with FocusLocationBar - UserMetrics::RecordAction(L"FocusSearch", profile_); + UserMetrics::RecordAction("FocusSearch", profile_); window_->GetLocationBar()->FocusSearch(); } void Browser::OpenFile() { - UserMetrics::RecordAction(L"OpenFile", profile_); + UserMetrics::RecordAction("OpenFile", profile_); if (!select_file_dialog_.get()) select_file_dialog_ = SelectFileDialog::Create(this); @@ -1146,7 +1146,7 @@ void Browser::OpenFile() { } void Browser::OpenCreateShortcutsDialog() { - UserMetrics::RecordAction(L"CreateShortcut", profile_); + UserMetrics::RecordAction("CreateShortcut", profile_); #if defined(OS_WIN) || defined(OS_LINUX) TabContents* current_tab = GetSelectedTabContents(); DCHECK(current_tab && current_tab->FavIconIsValid()) << @@ -1166,15 +1166,15 @@ void Browser::OpenCreateShortcutsDialog() { void Browser::ToggleDevToolsWindow(bool open_console) { if (open_console) - UserMetrics::RecordAction(L"ToggleDevToolsConsole", profile_); + UserMetrics::RecordAction("ToggleDevToolsConsole", profile_); else - UserMetrics::RecordAction(L"ToggleDevTools", profile_); + UserMetrics::RecordAction("ToggleDevTools", profile_); DevToolsManager::GetInstance()->ToggleDevToolsWindow( GetSelectedTabContents()->render_view_host(), open_console); } void Browser::OpenTaskManager() { - UserMetrics::RecordAction(L"TaskManager", profile_); + UserMetrics::RecordAction("TaskManager", profile_); window_->ShowTaskManager(); } @@ -1182,7 +1182,7 @@ void Browser::OpenSelectProfileDialog() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) return; - UserMetrics::RecordAction(L"SelectProfile", profile_); + UserMetrics::RecordAction("SelectProfile", profile_); window_->ShowSelectProfileDialog(); } @@ -1190,17 +1190,17 @@ void Browser::OpenNewProfileDialog() { const CommandLine& command_line = *CommandLine::ForCurrentProcess(); if (!command_line.HasSwitch(switches::kEnableUserDataDirProfiles)) return; - UserMetrics::RecordAction(L"CreateProfile", profile_); + UserMetrics::RecordAction("CreateProfile", profile_); window_->ShowNewProfileDialog(); } void Browser::OpenBugReportDialog() { - UserMetrics::RecordAction(L"ReportBug", profile_); + UserMetrics::RecordAction("ReportBug", profile_); window_->ShowReportBugDialog(); } void Browser::ToggleBookmarkBar() { - UserMetrics::RecordAction(L"ShowBookmarksBar", profile_); + UserMetrics::RecordAction("ShowBookmarksBar", profile_); window_->ToggleBookmarkBar(); } @@ -1209,52 +1209,52 @@ void Browser::ToggleExtensionShelf() { switches::kShowExtensionsOnTop)) { return; } - UserMetrics::RecordAction(L"ToggleExtensionShelf", profile_); + UserMetrics::RecordAction("ToggleExtensionShelf", profile_); window_->ToggleExtensionShelf(); } void Browser::OpenBookmarkManager() { - UserMetrics::RecordAction(L"ShowBookmarkManager", profile_); + UserMetrics::RecordAction("ShowBookmarkManager", profile_); window_->ShowBookmarkManager(); } void Browser::ShowAppMenu() { - UserMetrics::RecordAction(L"ShowAppMenu", profile_); + UserMetrics::RecordAction("ShowAppMenu", profile_); window_->ShowAppMenu(); } void Browser::ShowPageMenu() { - UserMetrics::RecordAction(L"ShowPageMenu", profile_); + UserMetrics::RecordAction("ShowPageMenu", profile_); window_->ShowPageMenu(); } void Browser::ShowHistoryTab() { - UserMetrics::RecordAction(L"ShowHistory", profile_); + UserMetrics::RecordAction("ShowHistory", profile_); ShowSingleDOMUITab(GURL(chrome::kChromeUIHistoryURL)); } void Browser::ShowDownloadsTab() { - UserMetrics::RecordAction(L"ShowDownloads", profile_); + UserMetrics::RecordAction("ShowDownloads", profile_); ShowSingleDOMUITab(GURL(chrome::kChromeUIDownloadsURL)); } void Browser::ShowExtensionsTab() { - UserMetrics::RecordAction(L"ShowExtensions", profile_); + UserMetrics::RecordAction("ShowExtensions", profile_); ShowSingleDOMUITab(GURL(chrome::kChromeUIExtensionsURL)); } void Browser::OpenClearBrowsingDataDialog() { - UserMetrics::RecordAction(L"ClearBrowsingData_ShowDlg", profile_); + UserMetrics::RecordAction("ClearBrowsingData_ShowDlg", profile_); window_->ShowClearBrowsingDataDialog(); } void Browser::OpenOptionsDialog() { - UserMetrics::RecordAction(L"ShowOptions", profile_); + UserMetrics::RecordAction("ShowOptions", profile_); ShowOptionsWindow(OPTIONS_PAGE_DEFAULT, OPTIONS_GROUP_NONE, profile_); } void Browser::OpenKeywordEditor() { - UserMetrics::RecordAction(L"EditSearchEngines", profile_); + UserMetrics::RecordAction("EditSearchEngines", profile_); window_->ShowSearchEnginesDialog(); } @@ -1263,7 +1263,7 @@ void Browser::OpenPasswordManager() { } void Browser::OpenImportSettingsDialog() { - UserMetrics::RecordAction(L"Import_ShowDlg", profile_); + UserMetrics::RecordAction("Import_ShowDlg", profile_); window_->ShowImportDialog(); } @@ -1284,7 +1284,7 @@ void Browser::OpenSyncMyBookmarksDialog() { } void Browser::OpenAboutChromeDialog() { - UserMetrics::RecordAction(L"AboutChrome", profile_); + UserMetrics::RecordAction("AboutChrome", profile_); window_->ShowAboutChromeDialog(); } @@ -1302,7 +1302,7 @@ void Browser::OpenThemeGalleryTabAndActivate() { #if defined(OS_CHROMEOS) void Browser::ShowControlPanel() { - UserMetrics::RecordAction(L"ShowControlPanel", profile_); + UserMetrics::RecordAction("ShowControlPanel", profile_); ShowOptionsWindow(OPTIONS_PAGE_SETTINGS, OPTIONS_GROUP_NONE, profile_); } #endif diff --git a/chrome/browser/browser_theme_provider.cc b/chrome/browser/browser_theme_provider.cc index c127cab..021df08 100644 --- a/chrome/browser/browser_theme_provider.cc +++ b/chrome/browser/browser_theme_provider.cc @@ -509,7 +509,7 @@ void BrowserThemeProvider::SetTheme(Extension* extension) { WriteImagesToDisk(); NotifyThemeChanged(); - UserMetrics::RecordAction(L"Themes_Installed", profile_); + UserMetrics::RecordAction("Themes_Installed", profile_); } void BrowserThemeProvider::RemoveUnusedThemes() { @@ -534,7 +534,7 @@ void BrowserThemeProvider::RemoveUnusedThemes() { void BrowserThemeProvider::UseDefaultTheme() { ClearAllThemeData(); NotifyThemeChanged(); - UserMetrics::RecordAction(L"Themes_Reset", profile_); + UserMetrics::RecordAction("Themes_Reset", profile_); } std::string BrowserThemeProvider::GetThemeID() const { @@ -804,9 +804,9 @@ void BrowserThemeProvider::LoadThemePrefs() { if (process_images_) { WriteImagesToDisk(); - UserMetrics::RecordAction(L"Migrated noncached to cached theme.", profile_); + UserMetrics::RecordAction("Migrated noncached to cached theme.", profile_); } - UserMetrics::RecordAction(L"Themes_loaded", profile_); + UserMetrics::RecordAction("Themes_loaded", profile_); } void BrowserThemeProvider::NotifyThemeChanged() { diff --git a/chrome/browser/browsing_data_remover.cc b/chrome/browser/browsing_data_remover.cc index 4477ce7..652251c 100644 --- a/chrome/browser/browsing_data_remover.cc +++ b/chrome/browser/browsing_data_remover.cc @@ -66,7 +66,7 @@ void BrowsingDataRemover::Remove(int remove_mask) { HistoryService* history_service = profile_->GetHistoryService(Profile::EXPLICIT_ACCESS); if (history_service) { - UserMetrics::RecordAction(L"ClearBrowsingData_History", profile_); + UserMetrics::RecordAction("ClearBrowsingData_History", profile_); waiting_for_clear_history_ = true; history_service->ExpireHistoryBetween(delete_begin_, delete_end_, &request_consumer_, @@ -98,14 +98,14 @@ void BrowsingDataRemover::Remove(int remove_mask) { } if (remove_mask & REMOVE_DOWNLOADS) { - UserMetrics::RecordAction(L"ClearBrowsingData_Downloads", profile_); + UserMetrics::RecordAction("ClearBrowsingData_Downloads", profile_); DownloadManager* download_manager = profile_->GetDownloadManager(); download_manager->RemoveDownloadsBetween(delete_begin_, delete_end_); download_manager->ClearLastDownloadPath(); } if (remove_mask & REMOVE_COOKIES) { - UserMetrics::RecordAction(L"ClearBrowsingData_Cookies", profile_); + UserMetrics::RecordAction("ClearBrowsingData_Cookies", profile_); // Since we are running on the UI thread don't call GetURLRequestContext(). net::CookieMonster* cookie_monster = profile_->GetRequestContext()->GetCookieStore()->GetCookieMonster(); @@ -114,7 +114,7 @@ void BrowsingDataRemover::Remove(int remove_mask) { } if (remove_mask & REMOVE_PASSWORDS) { - UserMetrics::RecordAction(L"ClearBrowsingData_Passwords", profile_); + UserMetrics::RecordAction("ClearBrowsingData_Passwords", profile_); PasswordStore* password_store = profile_->GetPasswordStore(Profile::EXPLICIT_ACCESS); @@ -122,7 +122,7 @@ void BrowsingDataRemover::Remove(int remove_mask) { } if (remove_mask & REMOVE_FORM_DATA) { - UserMetrics::RecordAction(L"ClearBrowsingData_Autofill", profile_); + UserMetrics::RecordAction("ClearBrowsingData_Autofill", profile_); WebDataService* web_data_service = profile_->GetWebDataService(Profile::EXPLICIT_ACCESS); @@ -133,7 +133,7 @@ void BrowsingDataRemover::Remove(int remove_mask) { if (remove_mask & REMOVE_CACHE) { // Invoke ClearBrowsingDataView::ClearCache on the IO thread. waiting_for_clear_cache_ = true; - UserMetrics::RecordAction(L"ClearBrowsingData_Cache", profile_); + UserMetrics::RecordAction("ClearBrowsingData_Cache", profile_); URLRequestContextGetter* main_context_getter = profile_->GetRequestContext(); diff --git a/chrome/browser/chromeos/external_metrics.cc b/chrome/browser/chromeos/external_metrics.cc index 27c3f31..5d7ecfb 100644 --- a/chrome/browser/chromeos/external_metrics.cc +++ b/chrome/browser/chromeos/external_metrics.cc @@ -34,11 +34,11 @@ static Profile* external_metrics_profile = NULL; // call RecordAction in a way that gets picked up by the processing scripts. static void RecordTabOverviewKeystroke(const char* ignore) { - UserMetrics::RecordAction(L"TabOverview_Keystroke", external_metrics_profile); + UserMetrics::RecordAction("TabOverview_Keystroke", external_metrics_profile); } static void RecordTabOverviewExitMouse(const char* ignore) { - UserMetrics::RecordAction(L"TabOverview_ExitMouse", external_metrics_profile); + UserMetrics::RecordAction("TabOverview_ExitMouse", external_metrics_profile); } static void RecordBootTime(const char* info) { diff --git a/chrome/browser/chromeos/settings_contents_view.cc b/chrome/browser/chromeos/settings_contents_view.cc index 0c1998d..c310e36 100644 --- a/chrome/browser/chromeos/settings_contents_view.cc +++ b/chrome/browser/chromeos/settings_contents_view.cc @@ -482,15 +482,15 @@ void TouchpadSection::ButtonPressed( if (sender == enable_tap_to_click_checkbox_) { bool enabled = enable_tap_to_click_checkbox_->checked(); UserMetricsRecordAction(enabled ? - L"Options_TapToClickCheckbox_Enable" : - L"Options_TapToClickCheckbox_Disable", + "Options_TapToClickCheckbox_Enable" : + "Options_TapToClickCheckbox_Disable", profile()->GetPrefs()); tap_to_click_enabled_.SetValue(enabled); } else if (sender == enable_vert_edge_scroll_checkbox_) { bool enabled = enable_vert_edge_scroll_checkbox_->checked(); UserMetricsRecordAction(enabled ? - L"Options_VertEdgeScrollCheckbox_Enable" : - L"Options_VertEdgeScrollCheckbox_Disable", + "Options_VertEdgeScrollCheckbox_Enable" : + "Options_VertEdgeScrollCheckbox_Disable", profile()->GetPrefs()); vert_edge_scroll_enabled_.SetValue(enabled); } @@ -499,12 +499,12 @@ void TouchpadSection::ButtonPressed( void TouchpadSection::SliderValueChanged(views::Slider* sender) { if (sender == speed_factor_slider_) { double value = speed_factor_slider_->value(); - UserMetricsRecordAction(L"Options_SpeedFactorSlider_Changed", + UserMetricsRecordAction("Options_SpeedFactorSlider_Changed", profile()->GetPrefs()); speed_factor_.SetValue(value); } else if (sender == sensitivity_slider_) { double value = sensitivity_slider_->value(); - UserMetricsRecordAction(L"Options_SensitivitySlider_Changed", + UserMetricsRecordAction("Options_SensitivitySlider_Changed", profile()->GetPrefs()); sensitivity_.SetValue(value); } diff --git a/chrome/browser/cocoa/bookmark_bar_controller.mm b/chrome/browser/cocoa/bookmark_bar_controller.mm index 2dc56df..ffb0ea5 100644 --- a/chrome/browser/cocoa/bookmark_bar_controller.mm +++ b/chrome/browser/cocoa/bookmark_bar_controller.mm @@ -766,19 +766,19 @@ const NSTimeInterval kBookmarkBarAnimationDuration = 0.12; - (IBAction)openAllBookmarks:(id)sender { BookmarkNode* node = [self nodeFromMenuItem:sender]; [self openBookmarkNodesRecursive:node disposition:NEW_FOREGROUND_TAB]; - UserMetrics::RecordAction(L"OpenAllBookmarks", browser_->profile()); + UserMetrics::RecordAction("OpenAllBookmarks", browser_->profile()); } - (IBAction)openAllBookmarksNewWindow:(id)sender { BookmarkNode* node = [self nodeFromMenuItem:sender]; [self openBookmarkNodesRecursive:node disposition:NEW_WINDOW]; - UserMetrics::RecordAction(L"OpenAllBookmarksNewWindow", browser_->profile()); + UserMetrics::RecordAction("OpenAllBookmarksNewWindow", browser_->profile()); } - (IBAction)openAllBookmarksIncognitoWindow:(id)sender { BookmarkNode* node = [self nodeFromMenuItem:sender]; [self openBookmarkNodesRecursive:node disposition:OFF_THE_RECORD]; - UserMetrics::RecordAction(L"OpenAllBookmarksIncognitoWindow", browser_->profile()); + UserMetrics::RecordAction("OpenAllBookmarksIncognitoWindow", browser_->profile()); } // May be called from the bar or from a folder button. diff --git a/chrome/browser/cocoa/bookmark_bubble_controller.mm b/chrome/browser/cocoa/bookmark_bubble_controller.mm index 6fc0c2c..aba44b9 100644 --- a/chrome/browser/cocoa/bookmark_bubble_controller.mm +++ b/chrome/browser/cocoa/bookmark_bubble_controller.mm @@ -97,7 +97,7 @@ } - (IBAction)edit:(id)sender { - UserMetrics::RecordAction(L"BookmarkBubble_Edit", model_->profile()); + UserMetrics::RecordAction("BookmarkBubble_Edit", model_->profile()); [self showEditor]; } @@ -120,7 +120,7 @@ - (IBAction)remove:(id)sender { model_->SetURLStarred(node_->GetURL(), node_->GetTitle(), false); - UserMetrics::RecordAction(L"BookmarkBubble_Unstar", model_->profile()); + UserMetrics::RecordAction("BookmarkBubble_Unstar", model_->profile()); node_ = NULL; // no longer valid [self ok:sender]; } @@ -132,7 +132,7 @@ NSMenuItem* selected = [folderPopUpButton_ selectedItem]; ChooseAnotherFolder* chooseItem = [[self class] chooseAnotherFolderObject]; if ([[selected representedObject] isEqual:chooseItem]) { - UserMetrics::RecordAction(L"BookmarkBubble_EditFromCombobox", + UserMetrics::RecordAction("BookmarkBubble_EditFromCombobox", model_->profile()); [self showEditor]; } @@ -165,7 +165,7 @@ NSString* newTitle = [nameTextField_ stringValue]; if (![oldTitle isEqual:newTitle]) { model_->SetTitle(node_, base::SysNSStringToWide(newTitle)); - UserMetrics::RecordAction(L"BookmarkBubble_ChangeTitleInBubble", + UserMetrics::RecordAction("BookmarkBubble_ChangeTitleInBubble", model_->profile()); } // Then the parent folder. @@ -182,7 +182,7 @@ if (oldParent != newParent) { int index = newParent->GetChildCount(); model_->Move(node_, newParent, index); - UserMetrics::RecordAction(L"BookmarkBubble_ChangeParent", + UserMetrics::RecordAction("BookmarkBubble_ChangeParent", model_->profile()); } } diff --git a/chrome/browser/cocoa/preferences_window_controller.mm b/chrome/browser/cocoa/preferences_window_controller.mm index 4a811b8..7bb62c8 100644 --- a/chrome/browser/cocoa/preferences_window_controller.mm +++ b/chrome/browser/cocoa/preferences_window_controller.mm @@ -356,7 +356,7 @@ CGFloat AutoSizeUnderTheHoodContent(NSView* view, // queried to find out what happened. - (void)syncStateChanged; // Record the user performed a certain action and save the preferences. -- (void)recordUserAction:(const wchar_t*)action; +- (void)recordUserAction:(const char*)action; - (void)registerPrefObservers; - (void)unregisterPrefObservers; @@ -754,7 +754,7 @@ class PrefObserverBridge : public NotificationObserver, } // Record the user performed a certain action and save the preferences. -- (void)recordUserAction:(const wchar_t*)action { +- (void)recordUserAction:(const char*)action { UserMetrics::RecordComputedAction(action, profile_); if (prefs_) prefs_->ScheduleSavePersistentPrefs(); @@ -877,13 +877,13 @@ class PrefObserverBridge : public NotificationObserver, static_cast<SessionStartupPref::Type>(type); switch (startupType) { case SessionStartupPref::DEFAULT: - [self recordUserAction:L"Options_Startup_Homepage"]; + [self recordUserAction:"Options_Startup_Homepage"]; break; case SessionStartupPref::LAST: - [self recordUserAction:L"Options_Startup_LastSession"]; + [self recordUserAction:"Options_Startup_LastSession"]; break; case SessionStartupPref::URLS: - [self recordUserAction:L"Options_Startup_Custom"]; + [self recordUserAction:"Options_Startup_Custom"]; break; default: NOTREACHED(); @@ -971,9 +971,9 @@ enum { kHomepageNewTabPage, kHomepageURL }; - (void)setNewTabPageIsHomePageIndex:(NSInteger)index { bool useNewTabPage = index == kHomepageNewTabPage ? true : false; if (useNewTabPage) - [self recordUserAction:L"Options_Homepage_UseNewTab"]; + [self recordUserAction:"Options_Homepage_UseNewTab"]; else - [self recordUserAction:L"Options_Homepage_UseURL"]; + [self recordUserAction:"Options_Homepage_UseURL"]; newTabPageIsHomePage_.SetValue(useNewTabPage); } @@ -1011,9 +1011,9 @@ enum { kHomepageNewTabPage, kHomepageURL }; // based on |value|. - (void)setShowHomeButton:(BOOL)value { if (value) - [self recordUserAction:L"Options_Homepage_ShowHomeButton"]; + [self recordUserAction:"Options_Homepage_ShowHomeButton"]; else - [self recordUserAction:L"Options_Homepage_HideHomeButton"]; + [self recordUserAction:"Options_Homepage_HideHomeButton"]; showHomeButton_.SetValue(value ? true : false); } @@ -1027,9 +1027,9 @@ enum { kHomepageNewTabPage, kHomepageURL }; // be displayed based on |value|. - (void)setShowPageOptionsButtons:(BOOL)value { if (value) - [self recordUserAction:L"Options_Homepage_ShowPageOptionsButtons"]; + [self recordUserAction:"Options_Homepage_ShowPageOptionsButtons"]; else - [self recordUserAction:L"Options_Homepage_HidePageOptionsButtons"]; + [self recordUserAction:"Options_Homepage_HidePageOptionsButtons"]; showPageOptionButtons_.SetValue(value ? true : false); } @@ -1046,7 +1046,7 @@ enum { kHomepageNewTabPage, kHomepageURL }; } - (void)setSearchEngineSelectedIndex:(NSUInteger)index { - [self recordUserAction:L"Options_SearchEngineChanged"]; + [self recordUserAction:"Options_SearchEngineChanged"]; [searchEngineModel_ setDefaultIndex:index]; } @@ -1066,7 +1066,7 @@ enum { kHomepageNewTabPage, kHomepageURL }; [self willChangeValueForKey:@"defaultBrowser"]; ShellIntegration::SetAsDefaultBrowser(); - [self recordUserAction:L"Options_SetAsDefaultBrowser"]; + [self recordUserAction:"Options_SetAsDefaultBrowser"]; // If the user made Chrome the default browser, then he/she arguably wants // to be notified when that changes. prefs_->SetBoolean(prefs::kCheckDefaultBrowser, true); @@ -1135,7 +1135,7 @@ const int kDisabledIndex = 1; // passwords. - (IBAction)showSavedPasswords:(id)sender { NSString* const kKeychainBundleId = @"com.apple.keychainaccess"; - [self recordUserAction:L"Options_ShowPasswordsExceptions"]; + [self recordUserAction:"Options_ShowPasswordsExceptions"]; [[NSWorkspace sharedWorkspace] launchAppWithBundleIdentifier:kKeychainBundleId options:0L @@ -1158,12 +1158,12 @@ const int kDisabledIndex = 1; } - (IBAction)resetThemeToDefault:(id)sender { - [self recordUserAction:L"Options_ThemesReset"]; + [self recordUserAction:"Options_ThemesReset"]; profile_->ClearTheme(); } - (IBAction)themesGallery:(id)sender { - [self recordUserAction:L"Options_ThemesGallery"]; + [self recordUserAction:"Options_ThemesGallery"]; Browser* browser = BrowserList::FindBrowserWithType(profile_, Browser::TYPE_NORMAL); @@ -1193,9 +1193,9 @@ const int kDisabledIndex = 1; - (void)setPasswordManagerEnabledIndex:(NSInteger)value { if (value == kEnabledIndex) - [self recordUserAction:L"Options_PasswordManager_Enable"]; + [self recordUserAction:"Options_PasswordManager_Enable"]; else - [self recordUserAction:L"Options_PasswordManager_Disable"]; + [self recordUserAction:"Options_PasswordManager_Disable"]; askSavePasswords_.SetValue(value == kEnabledIndex ? true : false); } @@ -1205,9 +1205,9 @@ const int kDisabledIndex = 1; - (void)setFormAutofillEnabledIndex:(NSInteger)value { if (value == kEnabledIndex) - [self recordUserAction:L"Options_FormAutofill_Enable"]; + [self recordUserAction:"Options_FormAutofill_Enable"]; else - [self recordUserAction:L"Options_FormAutofill_Disable"]; + [self recordUserAction:"Options_FormAutofill_Disable"]; formAutofill_.SetValue(value == kEnabledIndex ? true : false); } @@ -1217,9 +1217,9 @@ const int kDisabledIndex = 1; - (void)setIsUsingDefaultTheme:(BOOL)value { if (value) - [self recordUserAction:L"Options_IsUsingDefaultTheme_Enable"]; + [self recordUserAction:"Options_IsUsingDefaultTheme_Enable"]; else - [self recordUserAction:L"Options_IsUsingDefaultTheme_Disable"]; + [self recordUserAction:"Options_IsUsingDefaultTheme_Disable"]; } - (BOOL)isUsingDefaultTheme { @@ -1263,7 +1263,7 @@ const int kDisabledIndex = 1; code:(NSInteger)returnCode context:(void*)context { if (returnCode == NSOKButton) { - [self recordUserAction:L"Options_SetDownloadDirectory"]; + [self recordUserAction:"Options_SetDownloadDirectory"]; NSURL* path = [[panel URLs] lastObject]; // We only allow 1 item. [self willChangeValueForKey:@"defaultDownloadLocation"]; defaultDownloadLocation_.SetValue(base::SysNSStringToWide([path path])); @@ -1417,9 +1417,9 @@ const int kDisabledIndex = 1; // should be displayed based on |value|. - (void)setShowAlternateErrorPages:(BOOL)value { if (value) - [self recordUserAction:L"Options_LinkDoctorCheckbox_Enable"]; + [self recordUserAction:"Options_LinkDoctorCheckbox_Enable"]; else - [self recordUserAction:L"Options_LinkDoctorCheckbox_Disable"]; + [self recordUserAction:"Options_LinkDoctorCheckbox_Disable"]; alternateErrorPages_.SetValue(value ? true : false); } @@ -1433,9 +1433,9 @@ const int kDisabledIndex = 1; // displayed based on |value|. - (void)setUseSuggest:(BOOL)value { if (value) - [self recordUserAction:L"Options_UseSuggestCheckbox_Enable"]; + [self recordUserAction:"Options_UseSuggestCheckbox_Enable"]; else - [self recordUserAction:L"Options_UseSuggestCheckbox_Disable"]; + [self recordUserAction:"Options_UseSuggestCheckbox_Disable"]; useSuggest_.SetValue(value ? true : false); } @@ -1449,9 +1449,9 @@ const int kDisabledIndex = 1; // displayed based on |value|. - (void)setDnsPrefetch:(BOOL)value { if (value) - [self recordUserAction:L"Options_DnsPrefetchCheckbox_Enable"]; + [self recordUserAction:"Options_DnsPrefetchCheckbox_Enable"]; else - [self recordUserAction:L"Options_DnsPrefetchCheckbox_Disable"]; + [self recordUserAction:"Options_DnsPrefetchCheckbox_Disable"]; dnsPrefetch_.SetValue(value ? true : false); chrome_browser_net::EnableDnsPrefetch(value ? true : false); } @@ -1466,9 +1466,9 @@ const int kDisabledIndex = 1; // displayed based on |value|. - (void)setSafeBrowsing:(BOOL)value { if (value) - [self recordUserAction:L"Options_SafeBrowsingCheckbox_Enable"]; + [self recordUserAction:"Options_SafeBrowsingCheckbox_Enable"]; else - [self recordUserAction:L"Options_SafeBrowsingCheckbox_Disable"]; + [self recordUserAction:"Options_SafeBrowsingCheckbox_Disable"]; bool enabled = value ? true : false; safeBrowsing_.SetValue(enabled); SafeBrowsingService* safeBrowsingService = @@ -1487,9 +1487,9 @@ const int kDisabledIndex = 1; // displayed based on |value|. - (void)setMetricsRecording:(BOOL)value { if (value) - [self recordUserAction:L"Options_MetricsReportingCheckbox_Enable"]; + [self recordUserAction:"Options_MetricsReportingCheckbox_Enable"]; else - [self recordUserAction:L"Options_MetricsReportingCheckbox_Disable"]; + [self recordUserAction:"Options_MetricsReportingCheckbox_Disable"]; bool enabled = value ? true : false; GoogleUpdateSettings::SetCollectStatsConsent(enabled); @@ -1528,10 +1528,10 @@ const int kDisabledIndex = 1; net::CookiePolicy::Type policy = net::CookiePolicy::ALLOW_ALL_COOKIES; if (net::CookiePolicy::ValidType(index)) policy = net::CookiePolicy::FromInt(index); - const wchar_t* kUserMetrics[] = { - L"Options_AllowAllCookies", - L"Options_BlockThirdPartyCookies", - L"Options_BlockAllCookies" + const char* kUserMetrics[] = { + "Options_AllowAllCookies", + "Options_BlockThirdPartyCookies", + "Options_BlockAllCookies" }; DCHECK(policy >= 0 && (unsigned int)policy < arraysize(kUserMetrics)); [self recordUserAction:kUserMetrics[policy]]; @@ -1550,9 +1550,9 @@ const int kDisabledIndex = 1; - (void)setAskForSaveLocation:(BOOL)value { if (value) { - [self recordUserAction:L"Options_AskForSaveLocation_Enable"]; + [self recordUserAction:"Options_AskForSaveLocation_Enable"]; } else { - [self recordUserAction:L"Options_AskForSaveLocation_Disable"]; + [self recordUserAction:"Options_AskForSaveLocation_Disable"]; } askForSaveLocation_.SetValue(value); } diff --git a/chrome/browser/cocoa/tab_strip_controller.mm b/chrome/browser/cocoa/tab_strip_controller.mm index 4dd2148..9da7250 100644 --- a/chrome/browser/cocoa/tab_strip_controller.mm +++ b/chrome/browser/cocoa/tab_strip_controller.mm @@ -503,7 +503,7 @@ private: TabContents* contents = tabModel_->GetTabContentsAt(index); if (contents) - UserMetrics::RecordAction(L"CloseTab_Mouse", contents->profile()); + UserMetrics::RecordAction("CloseTab_Mouse", contents->profile()); const NSInteger numberOfTabViews = [self numberOfTabViews]; if (numberOfTabViews > 1) { bool isClosingLastTab = index == numberOfTabViews - 1; diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc index 5b77214..9369b00 100644 --- a/chrome/browser/dom_ui/new_tab_ui.cc +++ b/chrome/browser/dom_ui/new_tab_ui.cc @@ -489,7 +489,8 @@ void MetricsHandler::HandleMetrics(const Value* content) { static_cast<const StringValue*>(list_member); std::wstring wstring_value; if (string_value->GetAsString(&wstring_value)) { - UserMetrics::RecordComputedAction(wstring_value, dom_ui_->GetProfile()); + UserMetrics::RecordComputedAction(WideToASCII(wstring_value), + dom_ui_->GetProfile()); } } } diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index 7c22ccd..579b69e0 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -881,7 +881,7 @@ void BookmarkBarGtk::OnClicked(GtkWidget* sender, event_utils::DispositionFromEventFlags(event->state), PageTransition::AUTO_BOOKMARK); - UserMetrics::RecordAction(L"ClickedBookmarkBarURLButton", bar->profile_); + UserMetrics::RecordAction("ClickedBookmarkBarURLButton", bar->profile_); } // static diff --git a/chrome/browser/gtk/bookmark_bubble_gtk.cc b/chrome/browser/gtk/bookmark_bubble_gtk.cc index 0e82f2d..5b32c7f 100644 --- a/chrome/browser/gtk/bookmark_bubble_gtk.cc +++ b/chrome/browser/gtk/bookmark_bubble_gtk.cc @@ -281,7 +281,7 @@ void BookmarkBubbleGtk::HandleNameActivate() { void BookmarkBubbleGtk::HandleFolderChanged() { size_t cur_folder = gtk_combo_box_get_active(GTK_COMBO_BOX(folder_combo_)); if (cur_folder == folder_nodes_.size()) { - UserMetrics::RecordAction(L"BookmarkBubble_EditFromCombobox", profile_); + UserMetrics::RecordAction("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 @@ -303,7 +303,7 @@ void BookmarkBubbleGtk::HandleFolderPopupShown() { } void BookmarkBubbleGtk::HandleEditButton() { - UserMetrics::RecordAction(L"BookmarkBubble_Edit", profile_); + UserMetrics::RecordAction("BookmarkBubble_Edit", profile_); ShowEditor(); } @@ -312,7 +312,7 @@ void BookmarkBubbleGtk::HandleCloseButton() { } void BookmarkBubbleGtk::HandleRemoveButton() { - UserMetrics::RecordAction(L"BookmarkBubble_Unstar", profile_); + UserMetrics::RecordAction("BookmarkBubble_Unstar", profile_); apply_edits_ = false; remove_bookmark_ = true; @@ -333,7 +333,7 @@ void BookmarkBubbleGtk::ApplyEdits() { if (new_title != node->GetTitle()) { model->SetTitle(node, new_title); - UserMetrics::RecordAction(L"BookmarkBubble_ChangeTitleInBubble", + UserMetrics::RecordAction("BookmarkBubble_ChangeTitleInBubble", profile_); } @@ -343,7 +343,7 @@ void BookmarkBubbleGtk::ApplyEdits() { if (cur_folder < folder_nodes_.size()) { const BookmarkNode* new_parent = folder_nodes_[cur_folder]; if (new_parent != node->GetParent()) { - UserMetrics::RecordAction(L"BookmarkBubble_ChangeParent", profile_); + UserMetrics::RecordAction("BookmarkBubble_ChangeParent", profile_); model->Move(node, new_parent, new_parent->GetChildCount()); } } diff --git a/chrome/browser/gtk/bookmark_context_menu_gtk.cc b/chrome/browser/gtk/bookmark_context_menu_gtk.cc index b0b2819..8c94609 100644 --- a/chrome/browser/gtk/bookmark_context_menu_gtk.cc +++ b/chrome/browser/gtk/bookmark_context_menu_gtk.cc @@ -306,16 +306,16 @@ void BookmarkContextMenuGtk::ExecuteCommand(int id) { WindowOpenDisposition initial_disposition; if (id == IDS_BOOMARK_BAR_OPEN_ALL) { initial_disposition = NEW_FOREGROUND_TAB; - UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_OpenAll", + UserMetrics::RecordAction("BookmarkBar_ContextMenu_OpenAll", profile_); } else if (id == IDS_BOOMARK_BAR_OPEN_ALL_NEW_WINDOW) { initial_disposition = NEW_WINDOW; - UserMetrics::RecordAction( - L"BookmarkBar_ContextMenu_OpenAllInNewWindow", profile_); + UserMetrics::RecordAction("BookmarkBar_ContextMenu_OpenAllInNewWindow", + profile_); } else { initial_disposition = OFF_THE_RECORD; - UserMetrics::RecordAction( - L"BookmarkBar_ContextMenu_OpenAllIncognito", profile_); + UserMetrics::RecordAction("BookmarkBar_ContextMenu_OpenAllIncognito", + profile_); } bookmark_utils::OpenAll(wnd_, profile_, navigator, selection_, @@ -325,7 +325,7 @@ void BookmarkContextMenuGtk::ExecuteCommand(int id) { case IDS_BOOKMARK_BAR_RENAME_FOLDER: case IDS_BOOKMARK_BAR_EDIT: - UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_Edit", profile_); + UserMetrics::RecordAction("BookmarkBar_ContextMenu_Edit", profile_); if (selection_.size() != 1) { NOTREACHED(); @@ -348,7 +348,7 @@ void BookmarkContextMenuGtk::ExecuteCommand(int id) { break; case IDS_BOOKMARK_BAR_REMOVE: { - UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_Remove", profile_); + UserMetrics::RecordAction("BookmarkBar_ContextMenu_Remove", profile_); BookmarkModel* model = RemoveModelObserver(); for (size_t i = 0; i < selection_.size(); ++i) { @@ -360,7 +360,7 @@ void BookmarkContextMenuGtk::ExecuteCommand(int id) { } case IDS_BOOMARK_BAR_ADD_NEW_BOOKMARK: { - UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_Add", profile_); + UserMetrics::RecordAction("BookmarkBar_ContextMenu_Add", profile_); BookmarkEditor::Configuration editor_config; BookmarkEditor::Handler* handler = NULL; @@ -378,7 +378,7 @@ void BookmarkContextMenuGtk::ExecuteCommand(int id) { } case IDS_BOOMARK_BAR_NEW_FOLDER: { - UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_NewFolder", + UserMetrics::RecordAction("BookmarkBar_ContextMenu_NewFolder", profile_); EditFolderController::Show(profile_, wnd_, GetParentForNewNodes(), true, (configuration_ != BOOKMARK_BAR)); @@ -390,7 +390,7 @@ void BookmarkContextMenuGtk::ExecuteCommand(int id) { break; case IDS_BOOKMARK_MANAGER_SHOW_IN_FOLDER: - UserMetrics::RecordAction(L"BookmarkBar_ContextMenu_ShowInFolder", + UserMetrics::RecordAction("BookmarkBar_ContextMenu_ShowInFolder", profile_); if (selection_.size() != 1) { @@ -402,12 +402,12 @@ void BookmarkContextMenuGtk::ExecuteCommand(int id) { break; case IDS_BOOKMARK_MANAGER: - UserMetrics::RecordAction(L"ShowBookmarkManager", profile_); + UserMetrics::RecordAction("ShowBookmarkManager", profile_); BookmarkManager::Show(profile_); break; case IDS_BOOKMARK_MANAGER_SORT: - UserMetrics::RecordAction(L"BookmarkManager_Sort", profile_); + UserMetrics::RecordAction("BookmarkManager_Sort", profile_); model_->SortChildren(parent_); break; diff --git a/chrome/browser/gtk/options/advanced_contents_gtk.cc b/chrome/browser/gtk/options/advanced_contents_gtk.cc index 75711cf..48fa6da 100644 --- a/chrome/browser/gtk/options/advanced_contents_gtk.cc +++ b/chrome/browser/gtk/options/advanced_contents_gtk.cc @@ -272,7 +272,7 @@ 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(L"Options_SetDownloadDirectory", + section->UserMetricsRecordAction("Options_SetDownloadDirectory", section->profile()->GetPrefs()); } } @@ -284,10 +284,10 @@ void DownloadSection::OnDownloadAskForSaveLocationChanged( return; bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); if (enabled) { - section->UserMetricsRecordAction(L"Options_AskForSaveLocation_Enable", + section->UserMetricsRecordAction("Options_AskForSaveLocation_Enable", section->profile()->GetPrefs()); } else { - section->UserMetricsRecordAction(L"Options_AskForSaveLocation_Disable", + section->UserMetricsRecordAction("Options_AskForSaveLocation_Disable", section->profile()->GetPrefs()); } section->ask_for_save_location_.SetValue(enabled); @@ -297,7 +297,7 @@ void DownloadSection::OnDownloadAskForSaveLocationChanged( void DownloadSection::OnResetFileHandlersClicked(GtkButton *button, DownloadSection* section) { section->profile()->GetDownloadManager()->ResetAutoOpenFiles(); - section->UserMetricsRecordAction(L"Options_ResetAutoOpenFiles", + section->UserMetricsRecordAction("Options_ResetAutoOpenFiles", section->profile()->GetPrefs()); } @@ -362,7 +362,7 @@ NetworkSection::NetworkSection(Profile* profile) // static void NetworkSection::OnChangeProxiesButtonClicked(GtkButton *button, NetworkSection* section) { - section->UserMetricsRecordAction(L"Options_ChangeProxies", NULL); + section->UserMetricsRecordAction("Options_ChangeProxies", NULL); scoped_ptr<base::EnvironmentVariableGetter> env_getter( base::EnvironmentVariableGetter::Create()); @@ -646,8 +646,8 @@ void PrivacySection::OnEnableLinkDoctorChange(GtkWidget* widget, bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); privacy_section->UserMetricsRecordAction( enabled ? - L"Options_LinkDoctorCheckbox_Enable" : - L"Options_LinkDoctorCheckbox_Disable", + "Options_LinkDoctorCheckbox_Enable" : + "Options_LinkDoctorCheckbox_Disable", privacy_section->profile()->GetPrefs()); privacy_section->alternate_error_pages_.SetValue(enabled); } @@ -660,8 +660,8 @@ void PrivacySection::OnEnableSuggestChange(GtkWidget* widget, bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); privacy_section->UserMetricsRecordAction( enabled ? - L"Options_UseSuggestCheckbox_Enable" : - L"Options_UseSuggestCheckbox_Disable", + "Options_UseSuggestCheckbox_Enable" : + "Options_UseSuggestCheckbox_Disable", privacy_section->profile()->GetPrefs()); privacy_section->use_suggest_.SetValue(enabled); } @@ -674,8 +674,8 @@ void PrivacySection::OnDNSPrefetchingChange(GtkWidget* widget, bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); privacy_section->UserMetricsRecordAction( enabled ? - L"Options_DnsPrefetchCheckbox_Enable" : - L"Options_DnsPrefetchCheckbox_Disable", + "Options_DnsPrefetchCheckbox_Enable" : + "Options_DnsPrefetchCheckbox_Disable", privacy_section->profile()->GetPrefs()); privacy_section->dns_prefetch_enabled_.SetValue(enabled); chrome_browser_net::EnableDnsPrefetch(enabled); @@ -689,8 +689,8 @@ void PrivacySection::OnSafeBrowsingChange(GtkWidget* widget, bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); privacy_section->UserMetricsRecordAction( enabled ? - L"Options_SafeBrowsingCheckbox_Enable" : - L"Options_SafeBrowsingCheckbox_Disable", + "Options_SafeBrowsingCheckbox_Enable" : + "Options_SafeBrowsingCheckbox_Disable", privacy_section->profile()->GetPrefs()); privacy_section->safe_browsing_.SetValue(enabled); SafeBrowsingService* safe_browsing_service = @@ -707,8 +707,8 @@ void PrivacySection::OnLoggingChange(GtkWidget* widget, bool enabled = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget)); privacy_section->UserMetricsRecordAction( enabled ? - L"Options_MetricsReportingCheckbox_Enable" : - L"Options_MetricsReportingCheckbox_Disable", + "Options_MetricsReportingCheckbox_Enable" : + "Options_MetricsReportingCheckbox_Disable", privacy_section->profile()->GetPrefs()); // Prevent us from being called again by ResolveMetricsReportingEnabled // resetting the checkbox if there was a problem. @@ -731,10 +731,10 @@ void PrivacySection::OnCookieBehaviorChanged(GtkComboBox* combo_box, return; net::CookiePolicy::Type cookie_policy = net::CookiePolicy::FromInt(gtk_combo_box_get_active(combo_box)); - const wchar_t* kUserMetrics[] = { - L"Options_AllowAllCookies", - L"Options_BlockThirdPartyCookies", - L"Options_BlockAllCookies" + const char* kUserMetrics[] = { + "Options_AllowAllCookies", + "Options_BlockThirdPartyCookies", + "Options_BlockAllCookies" }; if (cookie_policy < 0 || static_cast<size_t>(cookie_policy) >= arraysize(kUserMetrics)) { @@ -749,7 +749,7 @@ void PrivacySection::OnCookieBehaviorChanged(GtkComboBox* combo_box, // static void PrivacySection::OnShowCookiesButtonClicked( GtkButton *button, PrivacySection* privacy_section) { - privacy_section->UserMetricsRecordAction(L"Options_ShowCookies", NULL); + privacy_section->UserMetricsRecordAction("Options_ShowCookies", NULL); CookiesView::Show(privacy_section->profile()); } @@ -951,10 +951,10 @@ void SecuritySection::OnRevCheckingEnabledToggled(GtkToggleButton* togglebutton, bool enabled = gtk_toggle_button_get_active(togglebutton); if (enabled) { - section->UserMetricsRecordAction(L"Options_CheckCertRevocation_Enable", + section->UserMetricsRecordAction("Options_CheckCertRevocation_Enable", NULL); } else { - section->UserMetricsRecordAction(L"Options_CheckCertRevocation_Disable", + section->UserMetricsRecordAction("Options_CheckCertRevocation_Disable", NULL); } section->rev_checking_enabled_.SetValue(enabled); @@ -968,9 +968,9 @@ void SecuritySection::OnSSL2EnabledToggled(GtkToggleButton* togglebutton, bool enabled = gtk_toggle_button_get_active(togglebutton); if (enabled) { - section->UserMetricsRecordAction(L"Options_SSL2_Enable", NULL); + section->UserMetricsRecordAction("Options_SSL2_Enable", NULL); } else { - section->UserMetricsRecordAction(L"Options_SSL2_Disable", NULL); + section->UserMetricsRecordAction("Options_SSL2_Disable", NULL); } section->ssl2_enabled_.SetValue(enabled); } @@ -983,9 +983,9 @@ void SecuritySection::OnSSL3EnabledToggled(GtkToggleButton* togglebutton, bool enabled = gtk_toggle_button_get_active(togglebutton); if (enabled) { - section->UserMetricsRecordAction(L"Options_SSL3_Enable", NULL); + section->UserMetricsRecordAction("Options_SSL3_Enable", NULL); } else { - section->UserMetricsRecordAction(L"Options_SSL3_Disable", NULL); + section->UserMetricsRecordAction("Options_SSL3_Disable", NULL); } section->ssl3_enabled_.SetValue(enabled); } @@ -998,9 +998,9 @@ void SecuritySection::OnTLS1EnabledToggled(GtkToggleButton* togglebutton, bool enabled = gtk_toggle_button_get_active(togglebutton); if (enabled) { - section->UserMetricsRecordAction(L"Options_TLS1_Enable", NULL); + section->UserMetricsRecordAction("Options_TLS1_Enable", NULL); } else { - section->UserMetricsRecordAction(L"Options_TLS1_Disable", NULL); + section->UserMetricsRecordAction("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 517669a..4271a33 100644 --- a/chrome/browser/gtk/options/advanced_page_gtk.cc +++ b/chrome/browser/gtk/options/advanced_page_gtk.cc @@ -48,7 +48,7 @@ void AdvancedPageGtk::Init() { // static void AdvancedPageGtk::OnResetToDefaultsClicked( GtkButton* button, AdvancedPageGtk* advanced_page) { - advanced_page->UserMetricsRecordAction(L"Options_ResetToDefaults", NULL); + advanced_page->UserMetricsRecordAction("Options_ResetToDefaults", NULL); GtkWidget* dialog_ = gtk_message_dialog_new( GTK_WINDOW(gtk_widget_get_toplevel(advanced_page->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 196f34c..a694c6f 100644 --- a/chrome/browser/gtk/options/content_page_gtk.cc +++ b/chrome/browser/gtk/options/content_page_gtk.cc @@ -406,7 +406,7 @@ void ContentPageGtk::OnClearBrowsingDataButtonClicked(GtkButton* widget, // static void ContentPageGtk::OnGtkThemeButtonClicked(GtkButton* widget, ContentPageGtk* page) { - page->UserMetricsRecordAction(L"Options_GtkThemeSet", + page->UserMetricsRecordAction("Options_GtkThemeSet", page->profile()->GetPrefs()); page->profile()->SetNativeTheme(); } @@ -414,7 +414,7 @@ void ContentPageGtk::OnGtkThemeButtonClicked(GtkButton* widget, // static void ContentPageGtk::OnResetDefaultThemeButtonClicked(GtkButton* widget, ContentPageGtk* page) { - page->UserMetricsRecordAction(L"Options_ThemesReset", + page->UserMetricsRecordAction("Options_ThemesReset", page->profile()->GetPrefs()); page->profile()->ClearTheme(); } @@ -422,7 +422,7 @@ void ContentPageGtk::OnResetDefaultThemeButtonClicked(GtkButton* widget, // static void ContentPageGtk::OnGetThemesButtonClicked(GtkButton* widget, ContentPageGtk* page) { - page->UserMetricsRecordAction(L"Options_ThemesGallery", + page->UserMetricsRecordAction("Options_ThemesGallery", page->profile()->GetPrefs()); BrowserList::GetLastActive()->OpenThemeGalleryTabAndActivate(); } @@ -443,10 +443,10 @@ void ContentPageGtk::OnSystemTitleBarRadioToggled(GtkToggleButton* widget, bool use_custom = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(page->system_title_bar_hide_radio_)); if (use_custom) { - page->UserMetricsRecordAction(L"Options_CustomFrame_Enable", + page->UserMetricsRecordAction("Options_CustomFrame_Enable", page->profile()->GetPrefs()); } else { - page->UserMetricsRecordAction(L"Options_CustomFrame_Disable", + page->UserMetricsRecordAction("Options_CustomFrame_Disable", page->profile()->GetPrefs()); } @@ -474,10 +474,10 @@ void ContentPageGtk::OnPasswordRadioToggled(GtkToggleButton* widget, bool enabled = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(page->passwords_asktosave_radio_)); if (enabled) { - page->UserMetricsRecordAction(L"Options_PasswordManager_Enable", + page->UserMetricsRecordAction("Options_PasswordManager_Enable", page->profile()->GetPrefs()); } else { - page->UserMetricsRecordAction(L"Options_PasswordManager_Disable", + page->UserMetricsRecordAction("Options_PasswordManager_Disable", page->profile()->GetPrefs()); } page->ask_to_save_passwords_.SetValue(enabled); @@ -498,10 +498,10 @@ void ContentPageGtk::OnAutofillRadioToggled(GtkToggleButton* widget, bool enabled = gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(page->form_autofill_asktosave_radio_)); if (enabled) { - page->UserMetricsRecordAction(L"Options_FormAutofill_Enable", + page->UserMetricsRecordAction("Options_FormAutofill_Enable", page->profile()->GetPrefs()); } else { - page->UserMetricsRecordAction(L"Options_FormAutofill_Disable", + page->UserMetricsRecordAction("Options_FormAutofill_Disable", page->profile()->GetPrefs()); } page->ask_to_save_form_autofill_.SetValue(enabled); diff --git a/chrome/browser/gtk/options/general_page_gtk.cc b/chrome/browser/gtk/options/general_page_gtk.cc index 58197d2..2054a8a 100644 --- a/chrome/browser/gtk/options/general_page_gtk.cc +++ b/chrome/browser/gtk/options/general_page_gtk.cc @@ -383,13 +383,13 @@ void GeneralPageGtk::OnStartupRadioToggled(GtkToggleButton* toggle_button, general_page->SaveStartupPref(); GtkWidget* sender = GTK_WIDGET(toggle_button); if (sender == general_page->startup_homepage_radio_) { - general_page->UserMetricsRecordAction(L"Options_Startup_Homepage", + general_page->UserMetricsRecordAction("Options_Startup_Homepage", general_page->profile()->GetPrefs()); } else if (sender == general_page->startup_last_session_radio_) { - general_page->UserMetricsRecordAction(L"Options_Startup_LastSession", + general_page->UserMetricsRecordAction("Options_Startup_LastSession", general_page->profile()->GetPrefs()); } else if (sender == general_page->startup_custom_radio_) { - general_page->UserMetricsRecordAction(L"Options_Startup_Custom", + general_page->UserMetricsRecordAction("Options_Startup_Custom", general_page->profile()->GetPrefs()); } } @@ -433,12 +433,12 @@ void GeneralPageGtk::OnNewTabIsHomePageToggled(GtkToggleButton* toggle_button, GtkWidget* sender = GTK_WIDGET(toggle_button); if (sender == general_page->homepage_use_newtab_radio_) { general_page->SetHomepage(GURL()); - general_page->UserMetricsRecordAction(L"Options_Homepage_UseNewTab", + general_page->UserMetricsRecordAction("Options_Homepage_UseNewTab", general_page->profile()->GetPrefs()); gtk_widget_set_sensitive(general_page->homepage_use_url_entry_, FALSE); } else if (sender == general_page->homepage_use_url_radio_) { general_page->SetHomepageFromEntry(); - general_page->UserMetricsRecordAction(L"Options_Homepage_UseURL", + general_page->UserMetricsRecordAction("Options_Homepage_UseURL", general_page->profile()->GetPrefs()); gtk_widget_set_sensitive(general_page->homepage_use_url_entry_, TRUE); } @@ -461,10 +461,10 @@ void GeneralPageGtk::OnShowHomeButtonToggled(GtkToggleButton* toggle_button, bool enabled = gtk_toggle_button_get_active(toggle_button); general_page->show_home_button_.SetValue(enabled); if (enabled) { - general_page->UserMetricsRecordAction(L"Options_Homepage_ShowHomeButton", + general_page->UserMetricsRecordAction("Options_Homepage_ShowHomeButton", general_page->profile()->GetPrefs()); } else { - general_page->UserMetricsRecordAction(L"Options_Homepage_HideHomeButton", + general_page->UserMetricsRecordAction("Options_Homepage_HideHomeButton", general_page->profile()->GetPrefs()); } } @@ -493,7 +493,7 @@ void GeneralPageGtk::OnBrowserUseAsDefaultClicked( // to be notified when that changes. general_page->profile()->GetPrefs()->SetBoolean(prefs::kCheckDefaultBrowser, true); - general_page->UserMetricsRecordAction(L"Options_SetAsDefaultBrowser", + general_page->UserMetricsRecordAction("Options_SetAsDefaultBrowser", general_page->profile()->GetPrefs()); } diff --git a/chrome/browser/gtk/options/languages_page_gtk.cc b/chrome/browser/gtk/options/languages_page_gtk.cc index b58f18f..0cd30d0 100644 --- a/chrome/browser/gtk/options/languages_page_gtk.cc +++ b/chrome/browser/gtk/options/languages_page_gtk.cc @@ -478,7 +478,7 @@ void LanguagesPageGtk::OnDictionaryLanguageChanged() { spellcheck_language_added_ = ""; } - UserMetricsRecordAction(L"Options_DictionaryLanguage", + UserMetricsRecordAction("Options_DictionaryLanguage", profile()->GetPrefs()); dictionary_language_.SetValue(ASCIIToWide(language)); } diff --git a/chrome/browser/metrics/metrics_log.cc b/chrome/browser/metrics/metrics_log.cc index 025fea8..dbf3e97 100644 --- a/chrome/browser/metrics/metrics_log.cc +++ b/chrome/browser/metrics/metrics_log.cc @@ -136,10 +136,10 @@ std::string MetricsLog::CreateBase64Hash(const std::string& string) { return std::string(); } -void MetricsLog::RecordUserAction(const wchar_t* key) { +void MetricsLog::RecordUserAction(const char* key) { DCHECK(!locked_); - std::string command_hash = CreateBase64Hash(WideToUTF8(key)); + std::string command_hash = CreateBase64Hash(key); if (command_hash.empty()) { NOTREACHED() << "Unable generate encoded hash of command: " << key; return; diff --git a/chrome/browser/metrics/metrics_log.h b/chrome/browser/metrics/metrics_log.h index 69b6f62..bcdd4f5 100644 --- a/chrome/browser/metrics/metrics_log.h +++ b/chrome/browser/metrics/metrics_log.h @@ -35,7 +35,7 @@ class MetricsLog { static void RegisterPrefs(PrefService* prefs); // Records a user-initiated action. - void RecordUserAction(const wchar_t* key); + void RecordUserAction(const char* key); enum WindowEventType { WINDOW_CREATE = 0, diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc index c49886a..79f1a8e 100644 --- a/chrome/browser/metrics/metrics_service.cc +++ b/chrome/browser/metrics/metrics_service.cc @@ -536,7 +536,7 @@ void MetricsService::Observe(NotificationType type, switch (type.value) { case NotificationType::USER_ACTION: - current_log_->RecordUserAction(*Details<const wchar_t*>(details).ptr()); + current_log_->RecordUserAction(*Details<const char*>(details).ptr()); break; case NotificationType::BROWSER_OPENED: diff --git a/chrome/browser/metrics/user_metrics.cc b/chrome/browser/metrics/user_metrics.cc index 8a27787..79b4dee 100644 --- a/chrome/browser/metrics/user_metrics.cc +++ b/chrome/browser/metrics/user_metrics.cc @@ -6,14 +6,14 @@ #include "chrome/browser/profile.h" #include "chrome/common/notification_service.h" -void UserMetrics::RecordAction(const wchar_t* action, Profile* profile) { +void UserMetrics::RecordAction(const char* action, Profile* profile) { NotificationService::current()->Notify( NotificationType::USER_ACTION, Source<Profile>(profile), - Details<const wchar_t*>(&action)); + Details<const char*>(&action)); } -void UserMetrics::RecordComputedAction(const std::wstring& action, +void UserMetrics::RecordComputedAction(const std::string& action, Profile* profile) { RecordAction(action.c_str(), profile); } diff --git a/chrome/browser/metrics/user_metrics.h b/chrome/browser/metrics/user_metrics.h index e937b21..4329fcc 100644 --- a/chrome/browser/metrics/user_metrics.h +++ b/chrome/browser/metrics/user_metrics.h @@ -22,18 +22,18 @@ class UserMetrics { // interacting with the browser. // WARNING: Call this function exactly like this, with the string literal // inline: - // UserMetrics::RecordAction(L"foo bar", profile); + // UserMetrics::RecordAction("foo bar", profile); // because otherwise our processing scripts won't pick up on new actions. // // For more complicated situations (like when there are many different // possible actions), see RecordComputedAction. - static void RecordAction(const wchar_t* action, Profile* profile); + static void RecordAction(const char* action, Profile* profile); // This function has identical input and behavior to RecordAction, but is // not automatically found by the action-processing scripts. It can be used // when it's a pain to enumerate all possible actions, but if you use this // you need to also update the rules for extracting known actions. - static void RecordComputedAction(const std::wstring& action, + static void RecordComputedAction(const std::string& action, Profile* profile); }; diff --git a/chrome/browser/options_page_base.cc b/chrome/browser/options_page_base.cc index d875f33..7f664eb5 100644 --- a/chrome/browser/options_page_base.cc +++ b/chrome/browser/options_page_base.cc @@ -18,7 +18,7 @@ OptionsPageBase::OptionsPageBase(Profile* profile) OptionsPageBase::~OptionsPageBase() { } -void OptionsPageBase::UserMetricsRecordAction(const wchar_t* action, +void OptionsPageBase::UserMetricsRecordAction(const char* action, PrefService* prefs) { UserMetrics::RecordComputedAction(action, profile()); if (prefs) diff --git a/chrome/browser/options_page_base.h b/chrome/browser/options_page_base.h index dd79767..6aac9c2 100644 --- a/chrome/browser/options_page_base.h +++ b/chrome/browser/options_page_base.h @@ -37,7 +37,7 @@ class OptionsPageBase : public NotificationObserver { Profile* profile() const { return profile_; } // Records a user action and schedules the prefs file to be saved. - void UserMetricsRecordAction(const wchar_t* action, PrefService* prefs); + void UserMetricsRecordAction(const char* action, PrefService* prefs); // Allows the UI to update when a preference value changes. The parameter is // the specific pref that changed, or NULL if all pref UI should be diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc index 5609bae..6b3307c 100644 --- a/chrome/browser/renderer_host/render_view_host.cc +++ b/chrome/browser/renderer_host/render_view_host.cc @@ -1477,7 +1477,7 @@ void RenderViewHost::OnDevToolsRuntimeFeatureStateChanged( RuntimeFeatureStateChanged(this, feature, enabled); } -void RenderViewHost::OnUserMetricsRecordAction(const std::wstring& action) { +void RenderViewHost::OnUserMetricsRecordAction(const std::string& action) { UserMetrics::RecordComputedAction(action.c_str(), process()->profile()); } diff --git a/chrome/browser/renderer_host/render_view_host.h b/chrome/browser/renderer_host/render_view_host.h index 21f72c5c..4b03af0 100644 --- a/chrome/browser/renderer_host/render_view_host.h +++ b/chrome/browser/renderer_host/render_view_host.h @@ -554,7 +554,7 @@ class RenderViewHost : public RenderWidgetHost, void OnDevToolsRuntimeFeatureStateChanged(const std::string& feature, bool enabled); - void OnUserMetricsRecordAction(const std::wstring& action); + void OnUserMetricsRecordAction(const std::string& action); void OnMissingPluginStatus(int status); void OnCrashedPlugin(const FilePath& plugin_path); diff --git a/chrome/browser/search_engines/edit_search_engine_controller.cc b/chrome/browser/search_engines/edit_search_engine_controller.cc index d8cacd1..8151603 100644 --- a/chrome/browser/search_engines/edit_search_engine_controller.cc +++ b/chrome/browser/search_engines/edit_search_engine_controller.cc @@ -93,7 +93,7 @@ void EditSearchEngineController::AcceptAddOrEdit( modifiable_url->SetURL(url_string, 0, 0); // TemplateURLModel takes ownership of template_url_. profile_->GetTemplateURLModel()->Add(modifiable_url); - UserMetrics::RecordAction(L"KeywordEditor_AddKeywordJS", profile_); + UserMetrics::RecordAction("KeywordEditor_AddKeywordJS", profile_); } else { // Adding or modifying an entry via the Delegate. edit_keyword_delegate_->OnEditedKeyword(template_url_, diff --git a/chrome/browser/search_engines/keyword_editor_controller.cc b/chrome/browser/search_engines/keyword_editor_controller.cc index 04b385d..9d8b9d9 100644 --- a/chrome/browser/search_engines/keyword_editor_controller.cc +++ b/chrome/browser/search_engines/keyword_editor_controller.cc @@ -32,7 +32,7 @@ int KeywordEditorController::AddTemplateURL(const std::wstring& title, const std::wstring& url) { DCHECK(!url.empty()); - UserMetrics::RecordAction(L"KeywordEditor_AddKeyword", profile_); + UserMetrics::RecordAction("KeywordEditor_AddKeyword", profile_); TemplateURL* template_url = new TemplateURL(); template_url->set_short_name(title); @@ -72,7 +72,7 @@ void KeywordEditorController::ModifyTemplateURL(const TemplateURL* template_url, table_model_->ModifyTemplateURL(index, title, keyword, url); - UserMetrics::RecordAction(L"KeywordEditor_ModifiedKeyword", profile_); + UserMetrics::RecordAction("KeywordEditor_ModifiedKeyword", profile_); } bool KeywordEditorController::CanMakeDefault(const TemplateURL* url) const { @@ -87,7 +87,7 @@ bool KeywordEditorController::CanRemove(const TemplateURL* url) const { void KeywordEditorController::RemoveTemplateURL(int index) { table_model_->Remove(index); - UserMetrics::RecordAction(L"KeywordEditor_RemoveKeyword", profile_); + UserMetrics::RecordAction("KeywordEditor_RemoveKeyword", profile_); } int KeywordEditorController::MakeDefaultTemplateURL(int index) { diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index 79134c7..9f5665c6 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -560,35 +560,35 @@ void RenderViewContextMenu::ExecuteItemCommand(int id) { break; case IDS_CONTENT_CONTEXT_PLAY: - UserMetrics::RecordAction(L"MediaContextMenu_Play", profile_); + UserMetrics::RecordAction("MediaContextMenu_Play", profile_); MediaPlayerActionAt(gfx::Point(params_.x, params_.y), WebMediaPlayerAction( WebMediaPlayerAction::Play, true)); break; case IDS_CONTENT_CONTEXT_PAUSE: - UserMetrics::RecordAction(L"MediaContextMenu_Pause", profile_); + UserMetrics::RecordAction("MediaContextMenu_Pause", profile_); MediaPlayerActionAt(gfx::Point(params_.x, params_.y), WebMediaPlayerAction( WebMediaPlayerAction::Play, false)); break; case IDS_CONTENT_CONTEXT_MUTE: - UserMetrics::RecordAction(L"MediaContextMenu_Mute", profile_); + UserMetrics::RecordAction("MediaContextMenu_Mute", profile_); MediaPlayerActionAt(gfx::Point(params_.x, params_.y), WebMediaPlayerAction( WebMediaPlayerAction::Mute, true)); break; case IDS_CONTENT_CONTEXT_UNMUTE: - UserMetrics::RecordAction(L"MediaContextMenu_Unmute", profile_); + UserMetrics::RecordAction("MediaContextMenu_Unmute", profile_); MediaPlayerActionAt(gfx::Point(params_.x, params_.y), WebMediaPlayerAction( WebMediaPlayerAction::Mute, false)); break; case IDS_CONTENT_CONTEXT_LOOP: - UserMetrics::RecordAction(L"MediaContextMenu_Loop", profile_); + UserMetrics::RecordAction("MediaContextMenu_Loop", profile_); MediaPlayerActionAt(gfx::Point(params_.x, params_.y), WebMediaPlayerAction( WebMediaPlayerAction::Loop, diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index 15c22f4..b44f01b 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -524,23 +524,23 @@ void TabStripModel::ExecuteContextMenuCommand( DCHECK(command_id > CommandFirst && command_id < CommandLast); switch (command_id) { case CommandNewTab: - UserMetrics::RecordAction(L"TabContextMenu_NewTab", profile_); + UserMetrics::RecordAction("TabContextMenu_NewTab", profile_); delegate()->AddBlankTabAt(context_index + 1, true); break; case CommandReload: - UserMetrics::RecordAction(L"TabContextMenu_Reload", profile_); + UserMetrics::RecordAction("TabContextMenu_Reload", profile_); GetContentsAt(context_index)->controller().Reload(true); break; case CommandDuplicate: - UserMetrics::RecordAction(L"TabContextMenu_Duplicate", profile_); + UserMetrics::RecordAction("TabContextMenu_Duplicate", profile_); delegate_->DuplicateContentsAt(context_index); break; case CommandCloseTab: - UserMetrics::RecordAction(L"TabContextMenu_CloseTab", profile_); + UserMetrics::RecordAction("TabContextMenu_CloseTab", profile_); CloseTabContentsAt(context_index); break; case CommandCloseOtherTabs: { - UserMetrics::RecordAction(L"TabContextMenu_CloseOtherTabs", profile_); + UserMetrics::RecordAction("TabContextMenu_CloseOtherTabs", profile_); TabContents* contents = GetTabContentsAt(context_index); std::vector<int> closing_tabs; for (int i = count() - 1; i >= 0; --i) { @@ -551,7 +551,7 @@ void TabStripModel::ExecuteContextMenuCommand( break; } case CommandCloseTabsToRight: { - UserMetrics::RecordAction(L"TabContextMenu_CloseTabsToRight", profile_); + UserMetrics::RecordAction("TabContextMenu_CloseTabsToRight", profile_); std::vector<int> closing_tabs; for (int i = count() - 1; i > context_index; --i) { closing_tabs.push_back(i); @@ -560,18 +560,18 @@ void TabStripModel::ExecuteContextMenuCommand( break; } case CommandCloseTabsOpenedBy: { - UserMetrics::RecordAction(L"TabContextMenu_CloseTabsOpenedBy", profile_); + UserMetrics::RecordAction("TabContextMenu_CloseTabsOpenedBy", profile_); std::vector<int> closing_tabs = GetIndexesOpenedBy(context_index); InternalCloseTabs(closing_tabs, true); break; } case CommandRestoreTab: { - UserMetrics::RecordAction(L"TabContextMenu_RestoreTab", profile_); + UserMetrics::RecordAction("TabContextMenu_RestoreTab", profile_); delegate_->RestoreTab(); break; } case CommandTogglePinned: { - UserMetrics::RecordAction(L"TabContextMenu_TogglePinned", profile_); + UserMetrics::RecordAction("TabContextMenu_TogglePinned", profile_); SelectTabContentsAt(context_index, true); SetTabPinned(context_index, !IsTabPinned(context_index)); @@ -579,7 +579,7 @@ void TabStripModel::ExecuteContextMenuCommand( } case CommandBookmarkAllTabs: { - UserMetrics::RecordAction(L"TabContextMenu_BookmarkAllTabs", profile_); + UserMetrics::RecordAction("TabContextMenu_BookmarkAllTabs", profile_); delegate_->BookmarkAllTabs(); break; diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc index e738067..f86b588 100755 --- a/chrome/browser/views/about_chrome_view.cc +++ b/chrome/browser/views/about_chrome_view.cc @@ -773,19 +773,19 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, switch (result) { case UPGRADE_STARTED: - UserMetrics::RecordAction(L"Upgrade_Started", profile_); + UserMetrics::RecordAction("Upgrade_Started", profile_); check_button_status_ = CHECKBUTTON_DISABLED; show_throbber = true; update_label_.SetText(l10n_util::GetString(IDS_UPGRADE_STARTED)); break; case UPGRADE_CHECK_STARTED: - UserMetrics::RecordAction(L"UpgradeCheck_Started", profile_); + UserMetrics::RecordAction("UpgradeCheck_Started", profile_); check_button_status_ = CHECKBUTTON_HIDDEN; show_throbber = true; update_label_.SetText(l10n_util::GetString(IDS_UPGRADE_CHECK_STARTED)); break; case UPGRADE_IS_AVAILABLE: - UserMetrics::RecordAction(L"UpgradeCheck_UpgradeIsAvailable", profile_); + UserMetrics::RecordAction("UpgradeCheck_UpgradeIsAvailable", profile_); check_button_status_ = CHECKBUTTON_ENABLED; update_label_.SetText( l10n_util::GetStringF(IDS_UPGRADE_AVAILABLE, @@ -802,7 +802,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, installer::Version::GetVersionFromString(current_version_)); if (!installed_version.get() || !installed_version->IsHigherThan(running_version.get())) { - UserMetrics::RecordAction(L"UpgradeCheck_AlreadyUpToDate", profile_); + UserMetrics::RecordAction("UpgradeCheck_AlreadyUpToDate", profile_); check_button_status_ = CHECKBUTTON_HIDDEN; std::wstring update_label_text = l10n_util::GetStringF(IDS_UPGRADE_ALREADY_UP_TO_DATE, @@ -820,9 +820,9 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, } case UPGRADE_SUCCESSFUL: { if (result == UPGRADE_ALREADY_UP_TO_DATE) - UserMetrics::RecordAction(L"UpgradeCheck_AlreadyUpgraded", profile_); + UserMetrics::RecordAction("UpgradeCheck_AlreadyUpgraded", profile_); else - UserMetrics::RecordAction(L"UpgradeCheck_Upgraded", profile_); + UserMetrics::RecordAction("UpgradeCheck_Upgraded", profile_); check_button_status_ = CHECKBUTTON_HIDDEN; const std::wstring& update_string = new_version_available_.empty() ? l10n_util::GetStringF(IDS_UPGRADE_SUCCESSFUL_NOVERSION, @@ -836,7 +836,7 @@ void AboutChromeView::UpdateStatus(GoogleUpdateUpgradeResult result, break; } case UPGRADE_ERROR: - UserMetrics::RecordAction(L"UpgradeCheck_Error", profile_); + UserMetrics::RecordAction("UpgradeCheck_Error", profile_); check_button_status_ = CHECKBUTTON_HIDDEN; update_label_.SetText(l10n_util::GetStringF(IDS_UPGRADE_ERROR, IntToWString(error_code))); diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index a8876de..ebb80e9 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -1081,7 +1081,7 @@ void BookmarkBarView::WriteDragData(View* sender, int press_x, int press_y, OSExchangeData* data) { - UserMetrics::RecordAction(L"BookmarkBar_DragButton", profile_); + UserMetrics::RecordAction("BookmarkBar_DragButton", profile_); for (int i = 0; i < GetBookmarkButtonCount(); ++i) { if (sender == GetBookmarkButton(i)) { @@ -1177,7 +1177,7 @@ void BookmarkBarView::ButtonPressed(views::Button* sender, bookmark_utils::OpenAll(GetWindow()->GetNativeWindow(), profile_, GetPageNavigator(), node, disposition_from_event_flags); } - UserMetrics::RecordAction(L"ClickedBookmarkBarURLButton", profile_); + UserMetrics::RecordAction("ClickedBookmarkBarURLButton", profile_); } void BookmarkBarView::ShowContextMenu(View* source, diff --git a/chrome/browser/views/bookmark_bubble_view.cc b/chrome/browser/views/bookmark_bubble_view.cc index 9c4465b..425d1ce5 100644 --- a/chrome/browser/views/bookmark_bubble_view.cc +++ b/chrome/browser/views/bookmark_bubble_view.cc @@ -331,7 +331,7 @@ void BookmarkBubbleView::ButtonPressed( void BookmarkBubbleView::LinkActivated(Link* source, int event_flags) { DCHECK(source == remove_link_); - UserMetrics::RecordAction(L"BookmarkBubble_Unstar", profile_); + UserMetrics::RecordAction("BookmarkBubble_Unstar", profile_); // Set this so we remove the bookmark after the window closes. remove_bookmark_ = true; @@ -344,7 +344,7 @@ void BookmarkBubbleView::ItemChanged(Combobox* combobox, int prev_index, int new_index) { if (new_index + 1 == parent_model_.GetItemCount()) { - UserMetrics::RecordAction(L"BookmarkBubble_EditFromCombobox", profile_); + UserMetrics::RecordAction("BookmarkBubble_EditFromCombobox", profile_); ShowEditor(); return; @@ -381,7 +381,7 @@ void BookmarkBubbleView::Close() { void BookmarkBubbleView::HandleButtonPressed(views::Button* sender) { if (sender == edit_button_) { - UserMetrics::RecordAction(L"BookmarkBubble_Edit", profile_); + UserMetrics::RecordAction("BookmarkBubble_Edit", profile_); ShowEditor(); } else { DCHECK(sender == close_button_); @@ -436,7 +436,7 @@ void BookmarkBubbleView::ApplyEdits() { const std::wstring new_title = UTF16ToWide(title_tf_->text()); if (new_title != node->GetTitle()) { model->SetTitle(node, new_title); - UserMetrics::RecordAction(L"BookmarkBubble_ChangeTitleInBubble", + UserMetrics::RecordAction("BookmarkBubble_ChangeTitleInBubble", profile_); } // Last index means 'Choose another folder...' @@ -445,7 +445,7 @@ void BookmarkBubbleView::ApplyEdits() { const BookmarkNode* new_parent = parent_model_.GetNodeAt(parent_combobox_->selected_item()); if (new_parent != node->GetParent()) { - UserMetrics::RecordAction(L"BookmarkBubble_ChangeParent", profile_); + UserMetrics::RecordAction("BookmarkBubble_ChangeParent", profile_); model->Move(node, new_parent, new_parent->GetChildCount()); } } diff --git a/chrome/browser/views/bookmark_manager_view.cc b/chrome/browser/views/bookmark_manager_view.cc index 3d15a30..dd717c4 100644 --- a/chrome/browser/views/bookmark_manager_view.cc +++ b/chrome/browser/views/bookmark_manager_view.cc @@ -512,7 +512,7 @@ void BookmarkManagerView::OnTreeViewKeyDown(base::KeyboardCode keycode) { void BookmarkManagerView::ButtonPressed(views::Button* sender, const views::Event& event) { if (sender == sync_status_button_) { - UserMetrics::RecordAction(L"BookmarkManager_Sync", profile_); + UserMetrics::RecordAction("BookmarkManager_Sync", profile_); OpenSyncMyBookmarksDialog(); } } @@ -575,12 +575,12 @@ void BookmarkManagerView::RunMenu(views::View* source, const gfx::Point& pt) { void BookmarkManagerView::ExecuteCommand(int id) { switch (id) { case IDS_BOOKMARK_MANAGER_IMPORT_MENU: - UserMetrics::RecordAction(L"BookmarkManager_Import", profile_); + UserMetrics::RecordAction("BookmarkManager_Import", profile_); ShowImportBookmarksFileChooser(); break; case IDS_BOOKMARK_MANAGER_EXPORT_MENU: - UserMetrics::RecordAction(L"BookmarkManager_Export", profile_); + UserMetrics::RecordAction("BookmarkManager_Export", profile_); ShowExportBookmarksFileChooser(); break; diff --git a/chrome/browser/views/bookmark_menu_controller_views.cc b/chrome/browser/views/bookmark_menu_controller_views.cc index a4cb731..5a7256b 100644 --- a/chrome/browser/views/bookmark_menu_controller_views.cc +++ b/chrome/browser/views/bookmark_menu_controller_views.cc @@ -225,7 +225,7 @@ void BookmarkMenuController::WriteDragData(MenuItemView* sender, OSExchangeData* data) { DCHECK(sender && data); - UserMetrics::RecordAction(L"BookmarkBar_DragFromFolder", profile_); + UserMetrics::RecordAction("BookmarkBar_DragFromFolder", profile_); BookmarkDragData drag_data(menu_id_to_node_map_[sender->GetCommand()]); drag_data.Write(profile_, data); diff --git a/chrome/browser/views/first_run_customize_view.cc b/chrome/browser/views/first_run_customize_view.cc index eaae13a..abc6f93 100644 --- a/chrome/browser/views/first_run_customize_view.cc +++ b/chrome/browser/views/first_run_customize_view.cc @@ -194,15 +194,15 @@ bool FirstRunCustomizeView::Accept() { quick_shortcut_cbox_->SetEnabled(false); if (desktop_shortcut_cbox_->checked()) { - UserMetrics::RecordAction(L"FirstRunCustom_Do_DesktopShortcut", profile_); + UserMetrics::RecordAction("FirstRunCustom_Do_DesktopShortcut", profile_); CreateDesktopShortcut(); } if (quick_shortcut_cbox_->checked()) { - UserMetrics::RecordAction(L"FirstRunCustom_Do_QuickLShortcut", profile_); + UserMetrics::RecordAction("FirstRunCustom_Do_QuickLShortcut", profile_); CreateQuickLaunchShortcut(); } if (!import_cbox_->checked()) { - UserMetrics::RecordAction(L"FirstRunCustom_No_Import", profile_); + UserMetrics::RecordAction("FirstRunCustom_No_Import", profile_); } else { int browser_selected = import_from_combo_->selected_item(); FirstRun::ImportSettings(profile_, diff --git a/chrome/browser/views/first_run_view.cc b/chrome/browser/views/first_run_view.cc index 0db3d75..79c6fdd 100644 --- a/chrome/browser/views/first_run_view.cc +++ b/chrome/browser/views/first_run_view.cc @@ -188,7 +188,7 @@ bool FirstRunView::Accept() { FirstRun::ImportSettings(profile_, importer_host_->GetSourceProfileInfoAt(0).browser_type, GetImportItems(), window()->GetNativeWindow()); - UserMetrics::RecordAction(L"FirstRunDef_Accept", profile_); + UserMetrics::RecordAction("FirstRunDef_Accept", profile_); if (default_browser_->checked()) SetDefaultBrowser(); @@ -199,7 +199,7 @@ bool FirstRunView::Accept() { } bool FirstRunView::Cancel() { - UserMetrics::RecordAction(L"FirstRunDef_Cancel", profile_); + UserMetrics::RecordAction("FirstRunDef_Cancel", profile_); MessageLoop::current()->PostTask(FROM_HERE, new MessageLoop::QuitTask()); return true; } @@ -213,5 +213,5 @@ void FirstRunView::CustomizeAccepted() { // Notification from the customize dialog that the user cancelled. void FirstRunView::CustomizeCanceled() { - UserMetrics::RecordAction(L"FirstRunCustom_Cancel", profile_); + UserMetrics::RecordAction("FirstRunCustom_Cancel", profile_); } diff --git a/chrome/browser/views/first_run_view_base.cc b/chrome/browser/views/first_run_view_base.cc index 1fa85d4..0fdd952 100644 --- a/chrome/browser/views/first_run_view_base.cc +++ b/chrome/browser/views/first_run_view_base.cc @@ -198,7 +198,7 @@ bool FirstRunViewBase::CreateQuickLaunchShortcut() { } bool FirstRunViewBase::SetDefaultBrowser() { - UserMetrics::RecordAction(L"FirstRun_Do_DefBrowser", profile_); + UserMetrics::RecordAction("FirstRun_Do_DefBrowser", profile_); return ShellIntegration::SetAsDefaultBrowser(); } diff --git a/chrome/browser/views/new_browser_window_widget.cc b/chrome/browser/views/new_browser_window_widget.cc index c8d3cf7..7cc3950 100644 --- a/chrome/browser/views/new_browser_window_widget.cc +++ b/chrome/browser/views/new_browser_window_widget.cc @@ -47,7 +47,7 @@ NewBrowserWindowWidget::~NewBrowserWindowWidget() { void NewBrowserWindowWidget::ButtonPressed( views::Button* sender, const views::Event& event) { - UserMetrics::RecordAction(L"TabOverview_PressedCreateNewBrowserButton", + UserMetrics::RecordAction("TabOverview_PressedCreateNewBrowserButton", profile_); Browser* browser = Browser::Create(profile_); diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc index a6d62a1..221383b 100644 --- a/chrome/browser/views/options/advanced_contents_view.cc +++ b/chrome/browser/views/options/advanced_contents_view.cc @@ -534,30 +534,30 @@ void PrivacySection::ButtonPressed( if (sender == enable_link_doctor_checkbox_) { bool enabled = enable_link_doctor_checkbox_->checked(); UserMetricsRecordAction(enabled ? - L"Options_LinkDoctorCheckbox_Enable" : - L"Options_LinkDoctorCheckbox_Disable", + "Options_LinkDoctorCheckbox_Enable" : + "Options_LinkDoctorCheckbox_Disable", profile()->GetPrefs()); alternate_error_pages_.SetValue(enabled); } else if (sender == enable_suggest_checkbox_) { bool enabled = enable_suggest_checkbox_->checked(); UserMetricsRecordAction(enabled ? - L"Options_UseSuggestCheckbox_Enable" : - L"Options_UseSuggestCheckbox_Disable", + "Options_UseSuggestCheckbox_Enable" : + "Options_UseSuggestCheckbox_Disable", profile()->GetPrefs()); use_suggest_.SetValue(enabled); } else if (sender == enable_dns_prefetching_checkbox_) { bool enabled = enable_dns_prefetching_checkbox_->checked(); UserMetricsRecordAction(enabled ? - L"Options_DnsPrefetchCheckbox_Enable" : - L"Options_DnsPrefetchCheckbox_Disable", + "Options_DnsPrefetchCheckbox_Enable" : + "Options_DnsPrefetchCheckbox_Disable", profile()->GetPrefs()); dns_prefetch_enabled_.SetValue(enabled); chrome_browser_net::EnableDnsPrefetch(enabled); } else if (sender == enable_safe_browsing_checkbox_) { bool enabled = enable_safe_browsing_checkbox_->checked(); UserMetricsRecordAction(enabled ? - L"Options_SafeBrowsingCheckbox_Enable" : - L"Options_SafeBrowsingCheckbox_Disable", + "Options_SafeBrowsingCheckbox_Enable" : + "Options_SafeBrowsingCheckbox_Disable", profile()->GetPrefs()); safe_browsing_.SetValue(enabled); SafeBrowsingService* safe_browsing_service = @@ -567,15 +567,15 @@ void PrivacySection::ButtonPressed( } else if (sender == reporting_enabled_checkbox_) { bool enabled = reporting_enabled_checkbox_->checked(); UserMetricsRecordAction(enabled ? - L"Options_MetricsReportingCheckbox_Enable" : - L"Options_MetricsReportingCheckbox_Disable", + "Options_MetricsReportingCheckbox_Enable" : + "Options_MetricsReportingCheckbox_Disable", profile()->GetPrefs()); ResolveMetricsReportingEnabled(); if (enabled == reporting_enabled_checkbox_->checked()) RestartMessageBox::ShowMessageBox(GetWindow()->GetNativeWindow()); enable_metrics_recording_.SetValue(enabled); } else if (sender == show_cookies_button_) { - UserMetricsRecordAction(L"Options_ShowCookies", NULL); + UserMetricsRecordAction("Options_ShowCookies", NULL); CookiesView::ShowCookiesWindow(profile()); } } @@ -610,10 +610,10 @@ void PrivacySection::ItemChanged(views::Combobox* sender, if (sender == cookie_behavior_combobox_) { net::CookiePolicy::Type cookie_policy = CookieBehaviorComboModel::IndexToCookiePolicy(new_index); - const wchar_t* kUserMetrics[] = { - L"Options_AllowAllCookies", - L"Options_BlockThirdPartyCookies", - L"Options_BlockAllCookies" + const char* kUserMetrics[] = { + "Options_AllowAllCookies", + "Options_BlockThirdPartyCookies", + "Options_BlockAllCookies" }; DCHECK(cookie_policy >= 0 && cookie_policy < arraysize(kUserMetrics)); UserMetricsRecordAction(kUserMetrics[cookie_policy], profile()->GetPrefs()); @@ -788,7 +788,7 @@ WebContentSection::WebContentSection(Profile* profile) void WebContentSection::ButtonPressed( views::Button* sender, const views::Event& event) { if (sender == gears_settings_button_) { - UserMetricsRecordAction(L"Options_GearsSettings", NULL); + UserMetricsRecordAction("Options_GearsSettings", NULL); GearsSettingsPressed(GetAncestor(GetWidget()->GetNativeView(), GA_ROOT)); } else if (sender == change_content_fonts_button_) { views::Window::CreateChromeWindow( @@ -889,21 +889,21 @@ void SecuritySection::ButtonPressed( if (sender == enable_ssl2_checkbox_) { bool enabled = enable_ssl2_checkbox_->checked(); if (enabled) { - UserMetricsRecordAction(L"Options_SSL2_Enable", NULL); + UserMetricsRecordAction("Options_SSL2_Enable", NULL); } else { - UserMetricsRecordAction(L"Options_SSL2_Disable", NULL); + UserMetricsRecordAction("Options_SSL2_Disable", NULL); } net::SSLConfigServiceWin::SetSSL2Enabled(enabled); } else if (sender == check_for_cert_revocation_checkbox_) { bool enabled = check_for_cert_revocation_checkbox_->checked(); if (enabled) { - UserMetricsRecordAction(L"Options_CheckCertRevocation_Enable", NULL); + UserMetricsRecordAction("Options_CheckCertRevocation_Enable", NULL); } else { - UserMetricsRecordAction(L"Options_CheckCertRevocation_Disable", NULL); + UserMetricsRecordAction("Options_CheckCertRevocation_Disable", NULL); } net::SSLConfigServiceWin::SetRevCheckingEnabled(enabled); } else if (sender == manage_certificates_button_) { - UserMetricsRecordAction(L"Options_ManagerCerts", NULL); + UserMetricsRecordAction("Options_ManagerCerts", NULL); CRYPTUI_CERT_MGR_STRUCT cert_mgr = { 0 }; cert_mgr.dwSize = sizeof(CRYPTUI_CERT_MGR_STRUCT); cert_mgr.hwndParent = GetWindow()->GetNativeWindow(); @@ -1039,7 +1039,7 @@ NetworkSection::NetworkSection(Profile* profile) void NetworkSection::ButtonPressed( views::Button* sender, const views::Event& event) { if (sender == change_proxies_button_) { - UserMetricsRecordAction(L"Options_ChangeProxies", NULL); + UserMetricsRecordAction("Options_ChangeProxies", NULL); base::Thread* thread = g_browser_process->file_thread(); DCHECK(thread); thread->message_loop()->PostTask(FROM_HERE, new OpenConnectionDialogTask); @@ -1156,23 +1156,23 @@ void DownloadSection::ButtonPressed( } else if (sender == download_ask_for_save_location_checkbox_) { bool enabled = download_ask_for_save_location_checkbox_->checked(); if (enabled) { - UserMetricsRecordAction(L"Options_AskForSaveLocation_Enable", + UserMetricsRecordAction("Options_AskForSaveLocation_Enable", profile()->GetPrefs()); } else { - UserMetricsRecordAction(L"Options_AskForSaveLocation_Disable", + UserMetricsRecordAction("Options_AskForSaveLocation_Disable", profile()->GetPrefs()); } ask_for_save_location_.SetValue(enabled); } else if (sender == reset_file_handlers_button_) { profile()->GetDownloadManager()->ResetAutoOpenFiles(); - UserMetricsRecordAction(L"Options_ResetAutoOpenFiles", + UserMetricsRecordAction("Options_ResetAutoOpenFiles", profile()->GetPrefs()); } } void DownloadSection::FileSelected(const FilePath& path, int index, void* params) { - UserMetricsRecordAction(L"Options_SetDownloadDirectory", + UserMetricsRecordAction("Options_SetDownloadDirectory", profile()->GetPrefs()); default_download_location_.SetValue(path.ToWStringHack()); // We need to call this manually here since because we're setting the value diff --git a/chrome/browser/views/options/advanced_page_view.cc b/chrome/browser/views/options/advanced_page_view.cc index b30ee35..65114e7 100644 --- a/chrome/browser/views/options/advanced_page_view.cc +++ b/chrome/browser/views/options/advanced_page_view.cc @@ -105,7 +105,7 @@ void AdvancedPageView::ResetToDefaults() { void AdvancedPageView::ButtonPressed( views::Button* sender, const views::Event& event) { if (sender == reset_to_default_button_) { - UserMetricsRecordAction(L"Options_ResetToDefaults", NULL); + UserMetricsRecordAction("Options_ResetToDefaults", NULL); ResetDefaultsConfirmBox::ShowConfirmBox( GetWindow()->GetNativeWindow(), this); } diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc index fef0cbc..17dd616 100644 --- a/chrome/browser/views/options/content_page_view.cc +++ b/chrome/browser/views/options/content_page_view.cc @@ -85,10 +85,10 @@ void ContentPageView::ButtonPressed( sender == passwords_neversave_radio_) { bool enabled = passwords_asktosave_radio_->checked(); if (enabled) { - UserMetricsRecordAction(L"Options_PasswordManager_Enable", + UserMetricsRecordAction("Options_PasswordManager_Enable", profile()->GetPrefs()); } else { - UserMetricsRecordAction(L"Options_PasswordManager_Disable", + UserMetricsRecordAction("Options_PasswordManager_Disable", profile()->GetPrefs()); } ask_to_save_passwords_.SetValue(enabled); @@ -96,18 +96,18 @@ void ContentPageView::ButtonPressed( sender == form_autofill_neversave_radio_) { bool enabled = form_autofill_asktosave_radio_->checked(); if (enabled) { - UserMetricsRecordAction(L"Options_FormAutofill_Enable", + UserMetricsRecordAction("Options_FormAutofill_Enable", profile()->GetPrefs()); } else { - UserMetricsRecordAction(L"Options_FormAutofill_Disable", + UserMetricsRecordAction("Options_FormAutofill_Disable", profile()->GetPrefs()); } ask_to_save_form_autofill_.SetValue(enabled); } else if (sender == passwords_exceptions_button_) { - UserMetricsRecordAction(L"Options_ShowPasswordsExceptions", NULL); + UserMetricsRecordAction("Options_ShowPasswordsExceptions", NULL); PasswordsExceptionsWindowView::Show(profile()); } else if (sender == themes_reset_button_) { - UserMetricsRecordAction(L"Options_ThemesReset", profile()->GetPrefs()); + UserMetricsRecordAction("Options_ThemesReset", profile()->GetPrefs()); profile()->ClearTheme(); } else if (sender == import_button_) { views::Window::CreateChromeWindow( @@ -143,7 +143,7 @@ void ContentPageView::ButtonPressed( void ContentPageView::LinkActivated(views::Link* source, int event_flags) { if (source == themes_gallery_link_) { - UserMetricsRecordAction(L"Options_ThemesGallery", profile()->GetPrefs()); + UserMetricsRecordAction("Options_ThemesGallery", profile()->GetPrefs()); BrowserList::GetLastActive()->OpenThemeGalleryTabAndActivate(); return; } diff --git a/chrome/browser/views/options/general_page_view.cc b/chrome/browser/views/options/general_page_view.cc index af3fa6b..305c1a2 100644 --- a/chrome/browser/views/options/general_page_view.cc +++ b/chrome/browser/views/options/general_page_view.cc @@ -435,13 +435,13 @@ void GeneralPageView::ButtonPressed( sender == startup_custom_radio_) { SaveStartupPref(); if (sender == startup_homepage_radio_) { - UserMetricsRecordAction(L"Options_Startup_Homepage", + UserMetricsRecordAction("Options_Startup_Homepage", profile()->GetPrefs()); } else if (sender == startup_last_session_radio_) { - UserMetricsRecordAction(L"Options_Startup_LastSession", + UserMetricsRecordAction("Options_Startup_LastSession", profile()->GetPrefs()); } else if (sender == startup_custom_radio_) { - UserMetricsRecordAction(L"Options_Startup_Custom", + UserMetricsRecordAction("Options_Startup_Custom", profile()->GetPrefs()); } } else if (sender == startup_add_custom_page_button_) { @@ -451,33 +451,33 @@ void GeneralPageView::ButtonPressed( } else if (sender == startup_use_current_page_button_) { SetStartupURLToCurrentPage(); } else if (sender == homepage_use_newtab_radio_) { - UserMetricsRecordAction(L"Options_Homepage_UseNewTab", + UserMetricsRecordAction("Options_Homepage_UseNewTab", profile()->GetPrefs()); SetHomepage(GetNewTabUIURLString()); EnableHomepageURLField(false); } else if (sender == homepage_use_url_radio_) { - UserMetricsRecordAction(L"Options_Homepage_UseURL", + UserMetricsRecordAction("Options_Homepage_UseURL", profile()->GetPrefs()); SetHomepage(homepage_use_url_textfield_->text()); EnableHomepageURLField(true); } else if (sender == homepage_show_home_button_checkbox_) { bool show_button = homepage_show_home_button_checkbox_->checked(); if (show_button) { - UserMetricsRecordAction(L"Options_Homepage_ShowHomeButton", + UserMetricsRecordAction("Options_Homepage_ShowHomeButton", profile()->GetPrefs()); } else { - UserMetricsRecordAction(L"Options_Homepage_HideHomeButton", + UserMetricsRecordAction("Options_Homepage_HideHomeButton", profile()->GetPrefs()); } show_home_button_.SetValue(show_button); } else if (sender == default_browser_use_as_default_button_) { default_browser_worker_->StartSetAsDefaultBrowser(); - UserMetricsRecordAction(L"Options_SetAsDefaultBrowser", NULL); + UserMetricsRecordAction("Options_SetAsDefaultBrowser", NULL); // 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); } else if (sender == default_search_manage_engines_button_) { - UserMetricsRecordAction(L"Options_ManageSearchEngines", NULL); + UserMetricsRecordAction("Options_ManageSearchEngines", NULL); KeywordEditorView::Show(profile()); } } @@ -489,7 +489,7 @@ void GeneralPageView::ItemChanged(views::Combobox* combobox, int prev_index, int new_index) { if (combobox == default_search_engine_combobox_) { SetDefaultSearchProvider(); - UserMetricsRecordAction(L"Options_SearchEngineChanged", NULL); + UserMetricsRecordAction("Options_SearchEngineChanged", NULL); } } diff --git a/chrome/browser/views/options/languages_page_view.cc b/chrome/browser/views/options/languages_page_view.cc index 768fc98..d7c7604 100644 --- a/chrome/browser/views/options/languages_page_view.cc +++ b/chrome/browser/views/options/languages_page_view.cc @@ -550,7 +550,7 @@ void LanguagesPageView::SaveChanges() { } if (ui_language_index_selected_ != -1) { - UserMetricsRecordAction(L"Options_AppLanguage", + UserMetricsRecordAction("Options_AppLanguage", g_browser_process->local_state()); app_locale_.SetValue(ASCIIToWide(ui_language_model_-> GetLocaleFromIndex(ui_language_index_selected_))); @@ -562,7 +562,7 @@ void LanguagesPageView::SaveChanges() { } if (spellcheck_language_index_selected_ != -1) { - UserMetricsRecordAction(L"Options_DictionaryLanguage", + UserMetricsRecordAction("Options_DictionaryLanguage", profile()->GetPrefs()); dictionary_language_.SetValue(ASCIIToWide(dictionary_language_model_-> GetLocaleFromIndex(spellcheck_language_index_selected_))); diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc index f91a3f1..2cf7ca0 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/views/tabs/dragged_tab_controller.cc @@ -1216,42 +1216,42 @@ bool DraggedTabController::CompleteDrag() { if (dock_info_.type() != DockInfo::NONE) { switch (dock_info_.type()) { case DockInfo::LEFT_OF_WINDOW: - UserMetrics::RecordAction(L"DockingWindow_Left", + UserMetrics::RecordAction("DockingWindow_Left", source_tabstrip_->model()->profile()); break; case DockInfo::RIGHT_OF_WINDOW: - UserMetrics::RecordAction(L"DockingWindow_Right", + UserMetrics::RecordAction("DockingWindow_Right", source_tabstrip_->model()->profile()); break; case DockInfo::BOTTOM_OF_WINDOW: - UserMetrics::RecordAction(L"DockingWindow_Bottom", + UserMetrics::RecordAction("DockingWindow_Bottom", source_tabstrip_->model()->profile()); break; case DockInfo::TOP_OF_WINDOW: - UserMetrics::RecordAction(L"DockingWindow_Top", + UserMetrics::RecordAction("DockingWindow_Top", source_tabstrip_->model()->profile()); break; case DockInfo::MAXIMIZE: - UserMetrics::RecordAction(L"DockingWindow_Maximize", + UserMetrics::RecordAction("DockingWindow_Maximize", source_tabstrip_->model()->profile()); break; case DockInfo::LEFT_HALF: - UserMetrics::RecordAction(L"DockingWindow_LeftHalf", + UserMetrics::RecordAction("DockingWindow_LeftHalf", source_tabstrip_->model()->profile()); break; case DockInfo::RIGHT_HALF: - UserMetrics::RecordAction(L"DockingWindow_RightHalf", + UserMetrics::RecordAction("DockingWindow_RightHalf", source_tabstrip_->model()->profile()); break; case DockInfo::BOTTOM_HALF: - UserMetrics::RecordAction(L"DockingWindow_BottomHalf", + UserMetrics::RecordAction("DockingWindow_BottomHalf", source_tabstrip_->model()->profile()); break; diff --git a/chrome/browser/views/tabs/tab_overview_drag_controller.cc b/chrome/browser/views/tabs/tab_overview_drag_controller.cc index df9b73b..b609489 100644 --- a/chrome/browser/views/tabs/tab_overview_drag_controller.cc +++ b/chrome/browser/views/tabs/tab_overview_drag_controller.cc @@ -94,7 +94,7 @@ void TabOverviewDragController::Drag(const gfx::Point& location) { dragging_ = true; controller_->DragStarted(); grid()->set_floating_index(current_index_); - UserMetrics::RecordAction(L"TabOverview_DragCell", + UserMetrics::RecordAction("TabOverview_DragCell", original_model_->profile()); } if (dragging_) @@ -110,7 +110,7 @@ void TabOverviewDragController::CommitDrag(const gfx::Point& location) { if (mouse_over_mini_window_) { // Dragged over a mini window, add as the last tab to the browser. Attach(model()->count()); - UserMetrics::RecordAction(L"TabOverview_DropOnMiniWindow", + UserMetrics::RecordAction("TabOverview_DropOnMiniWindow", original_model_->profile()); } else { DropTab(location); @@ -339,7 +339,7 @@ void TabOverviewDragController::Detach(const gfx::Point& location) { return; } - UserMetrics::RecordAction(L"TabOverview_DetachCell", + UserMetrics::RecordAction("TabOverview_DetachCell", original_model_->profile()); detached_window_ = CreateDetachedWindow( diff --git a/chrome/browser/views/tabs/tab_overview_message_listener.cc b/chrome/browser/views/tabs/tab_overview_message_listener.cc index be91a6d..b812c2a 100644 --- a/chrome/browser/views/tabs/tab_overview_message_listener.cc +++ b/chrome/browser/views/tabs/tab_overview_message_listener.cc @@ -128,7 +128,7 @@ void TabOverviewMessageListener::ProcessMessage( select_message.set_param(0, message.param(1)); TabOverviewTypes::instance()->SendMessage(select_message); - UserMetrics::RecordAction(L"TabOverview_DragOverMiniWindow", + UserMetrics::RecordAction("TabOverview_DragOverMiniWindow", browser_window->browser()->profile()); } diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index ef64c48..ad8bcca 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -894,7 +894,7 @@ int TabStrip::OnPerformDrop(const DropTargetEvent& event) { return DragDropTypes::DRAG_NONE; if (drop_before) { - UserMetrics::RecordAction(L"Tab_DropURLBetweenTabs", model_->profile()); + UserMetrics::RecordAction("Tab_DropURLBetweenTabs", model_->profile()); // Insert a new tab. TabContents* contents = @@ -904,7 +904,7 @@ int TabStrip::OnPerformDrop(const DropTargetEvent& event) { model_->AddTabContents(contents, drop_index, false, PageTransition::GENERATED, true); } else { - UserMetrics::RecordAction(L"Tab_DropURLOnTab", model_->profile()); + UserMetrics::RecordAction("Tab_DropURLOnTab", model_->profile()); model_->GetTabContentsAt(drop_index)->controller().LoadURL( url, GURL(), PageTransition::GENERATED); @@ -1120,7 +1120,7 @@ void TabStrip::CloseTab(Tab* tab) { if (model_->ContainsIndex(tab_index)) { TabContents* contents = model_->GetTabContentsAt(tab_index); if (contents) - UserMetrics::RecordAction(L"CloseTab_Mouse", contents->profile()); + UserMetrics::RecordAction("CloseTab_Mouse", contents->profile()); Tab* last_tab = GetTabAt(GetTabCount() - 1); // Limit the width available to the TabStrip for laying out Tabs, so that // Tabs are not resized until a later time (when the mouse pointer leaves @@ -1244,7 +1244,7 @@ bool TabStrip::HasAvailableDragActions() const { void TabStrip::ButtonPressed(views::Button* sender, const views::Event& event) { if (sender == newtab_button_) { - UserMetrics::RecordAction(L"NewTab_Button", model_->profile()); + UserMetrics::RecordAction("NewTab_Button", model_->profile()); model_->delegate()->AddBlankTab(true); } } diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index 0747331..0929342 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -837,7 +837,7 @@ void ToolbarView::WriteDragData(views::View* sender, DCHECK( GetDragOperations(sender, press_x, press_y) != DragDropTypes::DRAG_NONE); - UserMetrics::RecordAction(L"Toolbar_DragStar", profile_); + UserMetrics::RecordAction("Toolbar_DragStar", profile_); // If there is a bookmark for the URL, add the bookmark drag data for it. We // do this to ensure the bookmark is moved, rather than creating an new |