Commit 2c0a4317 authored by pkasting@chromium.org's avatar pkasting@chromium.org

Cleanup:

  * Remove using directives
  * Make more functions file-scope instead of private + static
  * Make .cc and .h order match

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/7661005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96973 0039d316-1c4b-4281-b951-d872f2087c98
parent d600e2d2
...@@ -135,14 +135,6 @@ struct HistoryURLProviderParams { ...@@ -135,14 +135,6 @@ struct HistoryURLProviderParams {
// This class is an autocomplete provider and is also a pseudo-internal // This class is an autocomplete provider and is also a pseudo-internal
// component of the history system. See comments above. // component of the history system. See comments above.
//
// Note: This object can get leaked on shutdown if there are pending
// requests on the database (which hold a reference to us). Normally, these
// messages get flushed for each thread. We do a round trip from main, to
// history, back to main while holding a reference. If the main thread
// completes before the history thread, the message to delegate back to the
// main thread will not run and the reference will leak. Therefore, don't do
// anything on destruction.
class HistoryURLProvider : public HistoryProvider { class HistoryURLProvider : public HistoryProvider {
public: public:
HistoryURLProvider(ACProviderListener* listener, Profile* profile); HistoryURLProvider(ACProviderListener* listener, Profile* profile);
...@@ -156,7 +148,6 @@ class HistoryURLProvider : public HistoryProvider { ...@@ -156,7 +148,6 @@ class HistoryURLProvider : public HistoryProvider {
params_(NULL), params_(NULL),
languages_(languages) {} languages_(languages) {}
#endif #endif
// no destructor (see note above)
// AutocompleteProvider // AutocompleteProvider
virtual void Start(const AutocompleteInput& input, virtual void Start(const AutocompleteInput& input,
...@@ -196,44 +187,6 @@ class HistoryURLProvider : public HistoryProvider { ...@@ -196,44 +187,6 @@ class HistoryURLProvider : public HistoryProvider {
MatchType match_type, MatchType match_type,
size_t match_number); size_t match_number);
// Determines the confidence for a |match| when compared to all the
// |matches|. Returns a number in the range [0, 1].
static float CalculateConfidence(const history::HistoryMatch& match,
const history::HistoryMatches& matches);
// Given the user's |input| and a |match| created from it, reduce the
// match's URL to just a host. If this host still matches the user input,
// return it. Returns the empty string on failure.
static GURL ConvertToHostOnly(const history::HistoryMatch& match,
const string16& input);
// See if a shorter version of the best match should be created, and if so
// place it at the front of |matches|. This can suggest history URLs that
// are prefixes of the best match (if they've been visited enough, compared
// to the best match), or create host-only suggestions even when they haven't
// been visited before: if the user visited http://example.com/asdf once,
// we'll suggest http://example.com/ even if they've never been to it. See
// the function body for the exact heuristics used.
static void PromoteOrCreateShorterSuggestion(
history::URLDatabase* db,
const HistoryURLProviderParams& params,
bool have_what_you_typed_match,
const AutocompleteMatch& what_you_typed_match,
history::HistoryMatches* matches);
// Ensures that |matches| contains an entry for |info|, which may mean adding
// a new such entry (using |input_location| and |match_in_scheme|).
//
// If |promote| is true, this also ensures the entry is the first element in
// |matches|, moving or adding it to the front as appropriate. When
// |promote| is false, existing matches are left in place, and newly added
// matches are placed at the back.
static void EnsureMatchPresent(const history::URLRow& info,
size_t input_location,
bool match_in_scheme,
history::HistoryMatches* matches,
bool promote);
// Helper function that actually launches the two autocomplete passes. // Helper function that actually launches the two autocomplete passes.
void RunAutocompletePasses(const AutocompleteInput& input, void RunAutocompletePasses(const AutocompleteInput& input,
bool fixup_input_and_run_pass_1); bool fixup_input_and_run_pass_1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment