| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" | 5 #include "chrome/browser/spellchecker/spellcheck_host_metrics.h" |
| 6 | 6 |
| 7 #include "base/md5.h" | 7 #include "base/md5.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 | 9 |
| 10 SpellCheckHostMetrics::SpellCheckHostMetrics() | 10 SpellCheckHostMetrics::SpellCheckHostMetrics() |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 void SpellCheckHostMetrics::RecordCustomWordCountStats(size_t count) { | 32 void SpellCheckHostMetrics::RecordCustomWordCountStats(size_t count) { |
| 33 UMA_HISTOGRAM_COUNTS("SpellCheck.CustomWords", count); | 33 UMA_HISTOGRAM_COUNTS("SpellCheck.CustomWords", count); |
| 34 } | 34 } |
| 35 | 35 |
| 36 void SpellCheckHostMetrics::RecordEnabledStats(bool enabled) { | 36 void SpellCheckHostMetrics::RecordEnabledStats(bool enabled) { |
| 37 UMA_HISTOGRAM_BOOLEAN("SpellCheck.Enabled", enabled); | 37 UMA_HISTOGRAM_BOOLEAN("SpellCheck.Enabled", enabled); |
| 38 // Because SpellCheckHost is instantiated lazily, the size of | 38 // Because SpellCheckHost is instantiated lazily, the size of |
| 39 // custom dictionary is unknown at this time. We mark it as -1 and | 39 // custom dictionary is unknown at this time. We mark it as -1 and |
| 40 // record actual value later. See SpellCheckHost for more detail. | 40 // record actual value later. See SpellCheckHost for more detail. |
| 41 if (enabled) | 41 if (enabled) |
| 42 RecordCustomWordCountStats(-1); | 42 RecordCustomWordCountStats(static_cast<size_t>(-1)); |
| 43 } | 43 } |
| 44 | 44 |
| 45 void SpellCheckHostMetrics::RecordCheckedWordStats(const base::string16& word, | 45 void SpellCheckHostMetrics::RecordCheckedWordStats(const base::string16& word, |
| 46 bool misspell) { | 46 bool misspell) { |
| 47 spellchecked_word_count_++; | 47 spellchecked_word_count_++; |
| 48 if (misspell) { | 48 if (misspell) { |
| 49 misspelled_word_count_++; | 49 misspelled_word_count_++; |
| 50 // If an user misspelled, that user should be counted as a part of | 50 // If an user misspelled, that user should be counted as a part of |
| 51 // the population. So we ensure to instantiate the histogram | 51 // the population. So we ensure to instantiate the histogram |
| 52 // entries here at the first time. | 52 // entries here at the first time. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 if (suggestion_show_count_ != last_suggestion_show_count_) { | 138 if (suggestion_show_count_ != last_suggestion_show_count_) { |
| 139 DCHECK(suggestion_show_count_ > last_suggestion_show_count_); | 139 DCHECK(suggestion_show_count_ > last_suggestion_show_count_); |
| 140 UMA_HISTOGRAM_COUNTS("SpellCheck.ShownSuggestions", suggestion_show_count_); | 140 UMA_HISTOGRAM_COUNTS("SpellCheck.ShownSuggestions", suggestion_show_count_); |
| 141 last_suggestion_show_count_ = suggestion_show_count_; | 141 last_suggestion_show_count_ = suggestion_show_count_; |
| 142 } | 142 } |
| 143 } | 143 } |
| 144 | 144 |
| 145 void SpellCheckHostMetrics::RecordSpellingServiceStats(bool enabled) { | 145 void SpellCheckHostMetrics::RecordSpellingServiceStats(bool enabled) { |
| 146 UMA_HISTOGRAM_BOOLEAN("SpellCheck.SpellingService.Enabled", enabled); | 146 UMA_HISTOGRAM_BOOLEAN("SpellCheck.SpellingService.Enabled", enabled); |
| 147 } | 147 } |
| OLD | NEW |