| 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 10 matching lines...) Expand all Loading... |
| 21 const uint64 kHistogramTimerDurationInMinutes = 30; | 21 const uint64 kHistogramTimerDurationInMinutes = 30; |
| 22 recording_timer_.Start(FROM_HERE, | 22 recording_timer_.Start(FROM_HERE, |
| 23 base::TimeDelta::FromMinutes(kHistogramTimerDurationInMinutes), | 23 base::TimeDelta::FromMinutes(kHistogramTimerDurationInMinutes), |
| 24 this, &SpellCheckHostMetrics::OnHistogramTimerExpired); | 24 this, &SpellCheckHostMetrics::OnHistogramTimerExpired); |
| 25 RecordWordCounts(); | 25 RecordWordCounts(); |
| 26 } | 26 } |
| 27 | 27 |
| 28 SpellCheckHostMetrics::~SpellCheckHostMetrics() { | 28 SpellCheckHostMetrics::~SpellCheckHostMetrics() { |
| 29 } | 29 } |
| 30 | 30 |
| 31 // static |
| 31 void SpellCheckHostMetrics::RecordCustomWordCountStats(size_t count) { | 32 void SpellCheckHostMetrics::RecordCustomWordCountStats(size_t count) { |
| 32 UMA_HISTOGRAM_COUNTS("SpellCheck.CustomWords", count); | 33 UMA_HISTOGRAM_COUNTS("SpellCheck.CustomWords", count); |
| 33 } | 34 } |
| 34 | 35 |
| 35 void SpellCheckHostMetrics::RecordEnabledStats(bool enabled) { | 36 void SpellCheckHostMetrics::RecordEnabledStats(bool enabled) { |
| 36 UMA_HISTOGRAM_BOOLEAN("SpellCheck.Enabled", enabled); | 37 UMA_HISTOGRAM_BOOLEAN("SpellCheck.Enabled", enabled); |
| 37 // Because SpellCheckHost is instantiated lazily, the size of | 38 // Because SpellCheckHost is instantiated lazily, the size of |
| 38 // 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 |
| 39 // record actual value later. See SpellCheckHost for more detail. | 40 // record actual value later. See SpellCheckHost for more detail. |
| 40 if (enabled) | 41 if (enabled) |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 if (suggestion_show_count_ != last_suggestion_show_count_) { | 138 if (suggestion_show_count_ != last_suggestion_show_count_) { |
| 138 DCHECK(suggestion_show_count_ > last_suggestion_show_count_); | 139 DCHECK(suggestion_show_count_ > last_suggestion_show_count_); |
| 139 UMA_HISTOGRAM_COUNTS("SpellCheck.ShownSuggestions", suggestion_show_count_); | 140 UMA_HISTOGRAM_COUNTS("SpellCheck.ShownSuggestions", suggestion_show_count_); |
| 140 last_suggestion_show_count_ = suggestion_show_count_; | 141 last_suggestion_show_count_ = suggestion_show_count_; |
| 141 } | 142 } |
| 142 } | 143 } |
| 143 | 144 |
| 144 void SpellCheckHostMetrics::RecordSpellingServiceStats(bool enabled) { | 145 void SpellCheckHostMetrics::RecordSpellingServiceStats(bool enabled) { |
| 145 UMA_HISTOGRAM_BOOLEAN("SpellCheck.SpellingService.Enabled", enabled); | 146 UMA_HISTOGRAM_BOOLEAN("SpellCheck.SpellingService.Enabled", enabled); |
| 146 } | 147 } |
| OLD | NEW |