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

Unified Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 306103002: Record RenderViewContextMenu.Used histogram for commands handled by observers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sun 06/01/2014 14:24:41.89 Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_context_menu/render_view_context_menu.cc
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index be70702d0733b4fcc26956d4e9cad34f47964643..80b557ec2528ea3a71aa11ecf499ce5f41150288 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -205,8 +205,9 @@ const struct UmaEnumCommandIdPair {
{ 55, IDC_CONTENT_CONTEXT_SPELLING_TOGGLE },
{ 56, IDC_SPELLCHECK_LANGUAGES_FIRST },
{ 57, IDC_CONTENT_CONTEXT_SEARCHWEBFORIMAGE },
+ { 58, IDC_SPELLCHECK_SUGGESTION_0 },
// Add new items here and use |enum_id| from the next line.
- { 58, 0 }, // Must be the last. Increment |enum_id| when new IDC was added.
+ { 59, 0 }, // Must be the last. Increment |enum_id| when new IDC was added.
};
// Collapses large ranges of ids before looking for UMA enum.
@@ -231,6 +232,11 @@ int CollapleCommandsForUMA(int id) {
return IDC_SPELLCHECK_LANGUAGES_FIRST;
}
+ if (id >= IDC_SPELLCHECK_SUGGESTION_0 &&
+ id <= IDC_SPELLCHECK_SUGGESTION_LAST) {
+ return IDC_SPELLCHECK_SUGGESTION_0;
+ }
+
return id;
}
@@ -1416,6 +1422,8 @@ bool RenderViewContextMenu::IsCommandIdChecked(int id) const {
void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
command_executed_ = true;
+ RecordUsedItem(id);
+
// If this command is is added by one of our observers, we dispatch it to the
// observer.
ObserverListBase<RenderViewContextMenuObserver>::Iterator it(observers_);
@@ -1425,8 +1433,6 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
return observer->ExecuteCommand(id);
}
- RecordUsedItem(id);
-
RenderFrameHost* render_frame_host =
RenderFrameHost::FromID(render_process_id_, render_frame_id_);
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698