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

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

Issue 7607007: Add confidence to AutocompleteMatch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 9 years, 4 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/autocomplete/builtin_provider.h" 5 #include "chrome/browser/autocomplete/builtin_provider.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/browser_about_handler.h" 9 #include "chrome/browser/browser_about_handler.h"
10 #include "chrome/browser/net/url_fixer_upper.h" 10 #include "chrome/browser/net/url_fixer_upper.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 } 108 }
109 } 109 }
110 } 110 }
111 111
112 for (size_t i = 0; i < matches_.size(); ++i) 112 for (size_t i = 0; i < matches_.size(); ++i)
113 matches_[i].relevance = kRelevance + matches_.size() - (i + 1); 113 matches_[i].relevance = kRelevance + matches_.size() - (i + 1);
114 } 114 }
115 115
116 void BuiltinProvider::AddMatch(const string16& match_string, 116 void BuiltinProvider::AddMatch(const string16& match_string,
117 const ACMatchClassifications& styles) { 117 const ACMatchClassifications& styles) {
118 AutocompleteMatch match(this, kRelevance, false, 118 AutocompleteMatch match(this, kRelevance, 0.0f, false,
119 AutocompleteMatch::NAVSUGGEST); 119 AutocompleteMatch::NAVSUGGEST);
120 match.fill_into_edit = match_string; 120 match.fill_into_edit = match_string;
121 match.destination_url = GURL(match_string); 121 match.destination_url = GURL(match_string);
122 match.contents = match_string; 122 match.contents = match_string;
123 match.contents_class = styles; 123 match.contents_class = styles;
124 matches_.push_back(match); 124 matches_.push_back(match);
125 } 125 }
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_unittest.cc ('k') | chrome/browser/autocomplete/extension_app_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698