OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BOOKMARK_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_BOOKMARK_PROVIDER_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_BOOKMARK_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_BOOKMARK_PROVIDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "components/omnibox/autocomplete_input.h" | 10 #include "components/omnibox/autocomplete_input.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 // | 27 // |
28 // TODO(mrossetti): Propose a way to coordinate with the HQP the taking of typed | 28 // TODO(mrossetti): Propose a way to coordinate with the HQP the taking of typed |
29 // and visit counts and last visit dates, etc. into consideration while scoring. | 29 // and visit counts and last visit dates, etc. into consideration while scoring. |
30 class BookmarkProvider : public AutocompleteProvider { | 30 class BookmarkProvider : public AutocompleteProvider { |
31 public: | 31 public: |
32 explicit BookmarkProvider(Profile* profile); | 32 explicit BookmarkProvider(Profile* profile); |
33 | 33 |
34 // When |minimal_changes| is true short circuit any additional searching and | 34 // When |minimal_changes| is true short circuit any additional searching and |
35 // leave the previous matches for this provider unchanged, otherwise perform | 35 // leave the previous matches for this provider unchanged, otherwise perform |
36 // a complete search for |input| across all bookmark titles. | 36 // a complete search for |input| across all bookmark titles. |
37 void Start(const AutocompleteInput& input, bool minimal_changes) override; | 37 void Start(const AutocompleteInput& input, |
| 38 bool minimal_changes, |
| 39 bool called_due_to_focus) override; |
38 | 40 |
39 // Sets the BookmarkModel for unit tests. | 41 // Sets the BookmarkModel for unit tests. |
40 void set_bookmark_model_for_testing(BookmarkModel* bookmark_model) { | 42 void set_bookmark_model_for_testing(BookmarkModel* bookmark_model) { |
41 bookmark_model_ = bookmark_model; | 43 bookmark_model_ = bookmark_model; |
42 } | 44 } |
43 | 45 |
44 private: | 46 private: |
45 FRIEND_TEST_ALL_PREFIXES(BookmarkProviderTest, InlineAutocompletion); | 47 FRIEND_TEST_ALL_PREFIXES(BookmarkProviderTest, InlineAutocompletion); |
46 | 48 |
47 ~BookmarkProvider() override; | 49 ~BookmarkProvider() override; |
(...skipping 24 matching lines...) Expand all Loading... |
72 Profile* profile_; | 74 Profile* profile_; |
73 BookmarkModel* bookmark_model_; | 75 BookmarkModel* bookmark_model_; |
74 | 76 |
75 // Languages used during the URL formatting. | 77 // Languages used during the URL formatting. |
76 std::string languages_; | 78 std::string languages_; |
77 | 79 |
78 DISALLOW_COPY_AND_ASSIGN(BookmarkProvider); | 80 DISALLOW_COPY_AND_ASSIGN(BookmarkProvider); |
79 }; | 81 }; |
80 | 82 |
81 #endif // CHROME_BROWSER_AUTOCOMPLETE_BOOKMARK_PROVIDER_H_ | 83 #endif // CHROME_BROWSER_AUTOCOMPLETE_BOOKMARK_PROVIDER_H_ |
OLD | NEW |