summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-04 22:43:05 +0000
committervitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-04 22:43:05 +0000
commit495ab49d7f7a92676ba3abe15911bc80af13c2ed (patch)
tree007022e2b7f08e93bcb7839239b9249dd948ca56
parent44f65bff8f6e1c8bbd145d9b45496d9c9fb7b8e0 (diff)
downloadchromium_src-495ab49d7f7a92676ba3abe15911bc80af13c2ed.zip
chromium_src-495ab49d7f7a92676ba3abe15911bc80af13c2ed.tar.gz
chromium_src-495ab49d7f7a92676ba3abe15911bc80af13c2ed.tar.bz2
Merge 274161 "Record RenderViewContextMenu.Used histogram for co..."
> Record RenderViewContextMenu.Used histogram for commands handled by observers. > Added UMA constant for counting IDC_SPELLCHECK_SUGGESTION_*. > > TBR=asvitkine > BUG=378933 > > Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=273817 > > Review URL: https://codereview.chromium.org/306103002 TBR=vitalybuka@chromium.org Review URL: https://codereview.chromium.org/312203003 git-svn-id: svn://svn.chromium.org/chrome/branches/1985/src@274941 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/renderer_context_menu/render_view_context_menu.cc12
-rw-r--r--tools/metrics/histograms/histograms.xml1
2 files changed, 10 insertions, 3 deletions
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 0a418ca..2ac8c8c 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_);
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index bd221b3..d81a76c 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -40440,6 +40440,7 @@ Therefore, the affected-histogram name has to have at least one dot in it.
<int value="55" label="IDC_CONTENT_CONTEXT_SPELLING_TOGGLE"/>
<int value="56" label="IDC_SPELLCHECK_LANGUAGES_FIRST"/>
<int value="57" label="IDC_CONTENT_CONTEXT_SEARCHWEBFORIMAGE"/>
+ <int value="58" label="IDC_SPELLCHECK_SUGGESTION"/>
</enum>
<enum name="ResolutionCategory" type="int">