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

Side by Side Diff: chrome/browser/autocomplete/history_contents_provider.h

Issue 6268005: Removes the link in the omnibox for searching history. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix unit test Created 9 years, 11 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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_CONTENTS_PROVIDER_H_ 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_HISTORY_CONTENTS_PROVIDER_H_
6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_CONTENTS_PROVIDER_H_ 6 #define CHROME_BROWSER_AUTOCOMPLETE_HISTORY_CONTENTS_PROVIDER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/autocomplete/history_provider.h" 9 #include "chrome/browser/autocomplete/history_provider.h"
10 #include "chrome/browser/history/history.h" 10 #include "chrome/browser/history/history.h"
(...skipping 12 matching lines...) Expand all
23 class HistoryContentsProvider : public HistoryProvider { 23 class HistoryContentsProvider : public HistoryProvider {
24 public: 24 public:
25 HistoryContentsProvider(ACProviderListener* listener, Profile* profile); 25 HistoryContentsProvider(ACProviderListener* listener, Profile* profile);
26 26
27 // As necessary asks the history service for the relevant results. When 27 // As necessary asks the history service for the relevant results. When
28 // done SetResults is invoked. 28 // done SetResults is invoked.
29 virtual void Start(const AutocompleteInput& input, 29 virtual void Start(const AutocompleteInput& input,
30 bool minimal_changes) OVERRIDE; 30 bool minimal_changes) OVERRIDE;
31 virtual void Stop() OVERRIDE; 31 virtual void Stop() OVERRIDE;
32 32
33 // Returns the total number of matches available in the database, up to
34 // kMaxMatchCount, whichever is smaller.
35 // Return value is incomplete if done() returns false.
36 size_t db_match_count() const { return results_.size(); }
37
38 // The maximum match count we'll report. If the db_match_count is greater
39 // than this, it will be clamped to this result.
40 static const size_t kMaxMatchCount = 50;
41
42 private: 33 private:
43 ~HistoryContentsProvider(); 34 ~HistoryContentsProvider();
44 35
45 void QueryComplete(HistoryService::Handle handle, 36 void QueryComplete(HistoryService::Handle handle,
46 history::QueryResults* results); 37 history::QueryResults* results);
47 38
48 // Converts each MatchingPageResult in results_ to an AutocompleteMatch and 39 // Converts each MatchingPageResult in results_ to an AutocompleteMatch and
49 // adds it to matches_. 40 // adds it to matches_.
50 void ConvertResults(); 41 void ConvertResults();
51 42
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 // Whether results_ is valid (so we can tell invalid apart from empty). 83 // Whether results_ is valid (so we can tell invalid apart from empty).
93 bool have_results_; 84 bool have_results_;
94 85
95 // Current query string. 86 // Current query string.
96 std::wstring query_; 87 std::wstring query_;
97 88
98 DISALLOW_COPY_AND_ASSIGN(HistoryContentsProvider); 89 DISALLOW_COPY_AND_ASSIGN(HistoryContentsProvider);
99 }; 90 };
100 91
101 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_CONTENTS_PROVIDER_H_ 92 #endif // CHROME_BROWSER_AUTOCOMPLETE_HISTORY_CONTENTS_PROVIDER_H_
OLDNEW
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_unittest.cc ('k') | chrome/browser/autocomplete/history_contents_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698