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

Side by Side Diff: chrome/browser/spellchecker/spellcheck_host_metrics.cc

Issue 368133005: Fixes for re-enabling more MSVC level 4 warnings: chrome/browser/ edition (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comment Created 6 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/sessions/session_backend.cc ('k') | chrome/browser/sync/test/integration/typed_urls_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698