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

Side by Side Diff: chrome/browser/autocomplete/history_quick_provider.cc

Issue 10544114: Omnibox: In UMA logs, record typed_count of URLS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Grammar in comment. Created 8 years, 6 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/autocomplete/history_quick_provider.h" 5 #include "chrome/browser/autocomplete/history_quick_provider.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 } 186 }
187 } 187 }
188 188
189 AutocompleteMatch HistoryQuickProvider::QuickMatchToACMatch( 189 AutocompleteMatch HistoryQuickProvider::QuickMatchToACMatch(
190 const ScoredHistoryMatch& history_match, 190 const ScoredHistoryMatch& history_match,
191 int score) { 191 int score) {
192 const history::URLRow& info = history_match.url_info; 192 const history::URLRow& info = history_match.url_info;
193 AutocompleteMatch match(this, score, !!info.visit_count(), 193 AutocompleteMatch match(this, score, !!info.visit_count(),
194 history_match.url_matches.empty() ? 194 history_match.url_matches.empty() ?
195 AutocompleteMatch::HISTORY_TITLE : AutocompleteMatch::HISTORY_URL); 195 AutocompleteMatch::HISTORY_TITLE : AutocompleteMatch::HISTORY_URL);
196 match.typed_count = info.typed_count();
196 match.destination_url = info.url(); 197 match.destination_url = info.url();
197 DCHECK(match.destination_url.is_valid()); 198 DCHECK(match.destination_url.is_valid());
198 199
199 // Format the URL autocomplete presentation. 200 // Format the URL autocomplete presentation.
200 std::vector<size_t> offsets = 201 std::vector<size_t> offsets =
201 OffsetsFromTermMatches(history_match.url_matches); 202 OffsetsFromTermMatches(history_match.url_matches);
202 const net::FormatUrlTypes format_types = net::kFormatUrlOmitAll & 203 const net::FormatUrlTypes format_types = net::kFormatUrlOmitAll &
203 ~(!history_match.match_in_scheme ? 0 : net::kFormatUrlOmitHTTP); 204 ~(!history_match.match_in_scheme ? 0 : net::kFormatUrlOmitHTTP);
204 match.fill_into_edit = 205 match.fill_into_edit =
205 AutocompleteInput::FormattedStringWithEquivalentMeaning(info.url(), 206 AutocompleteInput::FormattedStringWithEquivalentMeaning(info.url(),
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 do { 270 do {
270 offset += matches[i].length; 271 offset += matches[i].length;
271 ++i; 272 ++i;
272 } while ((i < match_count) && (offset == matches[i].offset)); 273 } while ((i < match_count) && (offset == matches[i].offset));
273 if (offset < text_length) 274 if (offset < text_length)
274 spans.push_back(ACMatchClassification(offset, url_style)); 275 spans.push_back(ACMatchClassification(offset, url_style));
275 } 276 }
276 277
277 return spans; 278 return spans;
278 } 279 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_match.cc ('k') | chrome/browser/autocomplete/history_url_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698