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_SHORTCUTS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ |
6 #define CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ | 6 #define CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 10 matching lines...) Expand all Loading... |
21 // suggestion for a given search term the higher will be that suggestion's | 21 // suggestion for a given search term the higher will be that suggestion's |
22 // ranking for future uses of that search term. | 22 // ranking for future uses of that search term. |
23 class ShortcutsProvider | 23 class ShortcutsProvider |
24 : public AutocompleteProvider, | 24 : public AutocompleteProvider, |
25 public ShortcutsBackend::ShortcutsBackendObserver { | 25 public ShortcutsBackend::ShortcutsBackendObserver { |
26 public: | 26 public: |
27 explicit ShortcutsProvider(Profile* profile); | 27 explicit ShortcutsProvider(Profile* profile); |
28 | 28 |
29 // Performs the autocompletion synchronously. Since no asynch completion is | 29 // Performs the autocompletion synchronously. Since no asynch completion is |
30 // performed |minimal_changes| is ignored. | 30 // performed |minimal_changes| is ignored. |
31 void Start(const AutocompleteInput& input, bool minimal_changes) override; | 31 void Start(const AutocompleteInput& input, |
| 32 bool minimal_changes, |
| 33 bool called_due_to_focus) override; |
32 | 34 |
33 void DeleteMatch(const AutocompleteMatch& match) override; | 35 void DeleteMatch(const AutocompleteMatch& match) override; |
34 | 36 |
35 private: | 37 private: |
36 friend class ClassifyTest; | 38 friend class ClassifyTest; |
37 friend class ShortcutsProviderTest; | 39 friend class ShortcutsProviderTest; |
38 FRIEND_TEST_ALL_PREFIXES(ShortcutsProviderTest, CalculateScore); | 40 FRIEND_TEST_ALL_PREFIXES(ShortcutsProviderTest, CalculateScore); |
39 | 41 |
40 typedef std::multimap<base::char16, base::string16> WordMap; | 42 typedef std::multimap<base::char16, base::string16> WordMap; |
41 | 43 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 104 |
103 // The default max relevance unless overridden by a field trial. | 105 // The default max relevance unless overridden by a field trial. |
104 static const int kShortcutsProviderDefaultMaxRelevance; | 106 static const int kShortcutsProviderDefaultMaxRelevance; |
105 | 107 |
106 Profile* profile_; | 108 Profile* profile_; |
107 std::string languages_; | 109 std::string languages_; |
108 bool initialized_; | 110 bool initialized_; |
109 }; | 111 }; |
110 | 112 |
111 #endif // CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ | 113 #endif // CHROME_BROWSER_AUTOCOMPLETE_SHORTCUTS_PROVIDER_H_ |
OLD | NEW |