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

Unified Diff: chrome/browser/history/chrome_scored_history_match_client.h

Issue 903493002: Componentize ScoredHistoryMatch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 10 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/history/chrome_scored_history_match_client.h
diff --git a/chrome/browser/history/chrome_scored_history_match_client.h b/chrome/browser/history/chrome_scored_history_match_client.h
new file mode 100644
index 0000000000000000000000000000000000000000..4d9e53d834fdd7db9a54cd161e4879e8b9544ef1
--- /dev/null
+++ b/chrome/browser/history/chrome_scored_history_match_client.h
@@ -0,0 +1,43 @@
+// Copyright 2015 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_HISTORY_CHROME_SCORED_HISTORY_MATCH_CLIENT_H_
+#define CHROME_BROWSER_HISTORY_CHROME_SCORED_HISTORY_MATCH_CLIENT_H_
+
+#include "components/history/core/browser/scored_history_match_client.h"
+
+namespace bookmarks {
+class BookmarkModel;
+}
+
+class ChromeScoredHistoryMatchClient
+ : public history::ScoredHistoryMatchClient {
+ public:
+ explicit ChromeScoredHistoryMatchClient(
+ bookmarks::BookmarkModel* bookmark_model);
+ ~ChromeScoredHistoryMatchClient() override;
+
+ private:
+ // history::ScoredHistoryMatchClient implementation.
+ bool IsBoomarked(const GURL& url) const override;
+ int BookmarkValue() const override;
+ bool AllowTldMatches() const override;
+ bool AllowSchemeMatches() const override;
+ bool CanInlineAutocompleteMatch(const GURL& url,
+ const base::string16& term,
+ bool* innermost_match) const override;
+ base::string16 CleanUpUrlAndTitleForMatching(
+ const GURL& url,
+ const std::string& languages,
+ base::OffsetAdjuster::Adjustments* adjustments,
+ base::string16* title) const override;
+
+ // BookmarkModel to use for IsBookmarked() implementation; may be null during
+ // testing. Otherwise it must outlive ChromeScoreHistoryMatchClient.
+ bookmarks::BookmarkModel* bookmark_model_;
+
+ DISALLOW_COPY_AND_ASSIGN(ChromeScoredHistoryMatchClient);
+};
+
+#endif // CHROME_BROWSER_HISTORY_CHROME_SCORED_HISTORY_MATCH_CLIENT_H_
« no previous file with comments | « chrome/browser/autocomplete/history_url_provider.cc ('k') | chrome/browser/history/chrome_scored_history_match_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698