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

Unified Diff: chrome/browser/autocomplete/history_quick_provider.h

Issue 1182113009: Componentize HistoryQuickProvider and its supporting cast (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autocomplete/history_quick_provider.h
diff --git a/chrome/browser/autocomplete/history_quick_provider.h b/chrome/browser/autocomplete/history_quick_provider.h
deleted file mode 100644
index 0192efe6ec68aa24aaa518abfd0c42c164a1aa5e..0000000000000000000000000000000000000000
--- a/chrome/browser/autocomplete/history_quick_provider.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_
-#define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_
-
-#include <string>
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "chrome/browser/autocomplete/in_memory_url_index.h"
-#include "components/history/core/browser/history_types.h"
-#include "components/omnibox/autocomplete_input.h"
-#include "components/omnibox/autocomplete_match.h"
-#include "components/omnibox/history_provider.h"
-
-struct ScoredHistoryMatch;
-
-// This class is an autocomplete provider (a pseudo-internal component of
-// the history system) which quickly (and synchronously) provides matching
-// results from recently or frequently visited sites in the profile's
-// history.
-class HistoryQuickProvider : public HistoryProvider {
- public:
- HistoryQuickProvider(AutocompleteProviderClient* client,
- InMemoryURLIndex* in_memory_url_index);
-
- // AutocompleteProvider. |minimal_changes| is ignored since there is no asynch
- // completion performed.
- void Start(const AutocompleteInput& input, bool minimal_changes) override;
-
- // Disable this provider. For unit testing purposes only. This is required
- // because this provider is closely associated with the HistoryURLProvider
- // and in order to properly test the latter the HistoryQuickProvider must
- // be disabled.
- // TODO(mrossetti): Eliminate this once the HUP has been refactored.
- static void set_disabled(bool disabled) { disabled_ = disabled; }
-
- private:
- friend class HistoryQuickProviderTest;
- FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, Spans);
- FRIEND_TEST_ALL_PREFIXES(HistoryQuickProviderTest, Relevance);
-
- ~HistoryQuickProvider() override;
-
- // Performs the autocomplete matching and scoring.
- void DoAutocomplete();
-
- // Creates an AutocompleteMatch from |history_match|, assigning it
- // the score |score|.
- AutocompleteMatch QuickMatchToACMatch(const ScoredHistoryMatch& history_match,
- int score);
-
- AutocompleteInput autocomplete_input_;
- std::string languages_;
- InMemoryURLIndex* in_memory_url_index_; // Not owned by this class.
-
- // This provider is disabled when true.
- static bool disabled_;
-
- DISALLOW_COPY_AND_ASSIGN(HistoryQuickProvider);
-};
-
-#endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_QUICK_PROVIDER_H_
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_controller.cc ('k') | chrome/browser/autocomplete/history_quick_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698