summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/keyword_provider.cc
diff options
context:
space:
mode:
authordeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-27 12:08:09 +0000
committerdeanm@chromium.org <deanm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-27 12:08:09 +0000
commit6c85aa0142643695b48b76e6f1e02f58d191e712 (patch)
treeda7a8add1a6eefb45eba9a71613ef4f5618dd267 /chrome/browser/autocomplete/keyword_provider.cc
parent5fdf205ca33eda425379ed76c4686acda5e80ae2 (diff)
downloadchromium_src-6c85aa0142643695b48b76e6f1e02f58d191e712.zip
chromium_src-6c85aa0142643695b48b76e6f1e02f58d191e712.tar.gz
chromium_src-6c85aa0142643695b48b76e6f1e02f58d191e712.tar.bz2
Misc formatting / cleanup in the autocomplete code.
- Reformat / reword some comments. - Update include guards to the new style. - Remove trailing blank lines from end of files. - Clean up some includes. - Pull the CompareQuality functor into the implementation. - Pull kQueryDelayMs into the implementation. Review URL: http://codereview.chromium.org/27206 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10603 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/keyword_provider.cc')
-rw-r--r--chrome/browser/autocomplete/keyword_provider.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome/browser/autocomplete/keyword_provider.cc b/chrome/browser/autocomplete/keyword_provider.cc
index c267956..92ee1de 100644
--- a/chrome/browser/autocomplete/keyword_provider.cc
+++ b/chrome/browser/autocomplete/keyword_provider.cc
@@ -5,6 +5,7 @@
#include "chrome/browser/autocomplete/keyword_provider.h"
#include <algorithm>
+#include <vector>
#include "base/string_util.h"
#include "chrome/browser/profile.h"
@@ -40,7 +41,10 @@ KeywordProvider::KeywordProvider(ACProviderListener* listener,
}
-class KeywordProvider::CompareQuality {
+namespace {
+
+// Helper functor for Start(), for sorting keyword matches by quality.
+class CompareQuality {
public:
// A keyword is of higher quality when a greater fraction of it has been
// typed, that is, when it is shorter.
@@ -55,6 +59,8 @@ class KeywordProvider::CompareQuality {
}
};
+} // namespace
+
void KeywordProvider::Start(const AutocompleteInput& input,
bool minimal_changes) {
matches_.clear();
@@ -276,4 +282,3 @@ AutocompleteMatch KeywordProvider::CreateAutocompleteMatch(
return result;
}
-