| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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 COMPONENTS_OMNIBOX_BROWSER_PHYSICAL_WEB_PROVIDER_H_ | 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_PHYSICAL_WEB_PROVIDER_H_ |
| 6 #define COMPONENTS_OMNIBOX_BROWSER_PHYSICAL_WEB_PROVIDER_H_ | 6 #define COMPONENTS_OMNIBOX_BROWSER_PHYSICAL_WEB_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "components/omnibox/browser/autocomplete_input.h" | 9 #include "components/omnibox/browser/autocomplete_input.h" |
| 10 #include "components/omnibox/browser/autocomplete_provider.h" | 10 #include "components/omnibox/browser/autocomplete_provider.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 ~PhysicalWebProvider() override; | 31 ~PhysicalWebProvider() override; |
| 32 | 32 |
| 33 // Adds a separate match item to |matches_| for each nearby URL in | 33 // Adds a separate match item to |matches_| for each nearby URL in |
| 34 // |metadata_list|, up to the maximum number of matches allowed. If the total | 34 // |metadata_list|, up to the maximum number of matches allowed. If the total |
| 35 // number of nearby URLs exceeds this limit, one match is used for an overflow | 35 // number of nearby URLs exceeds this limit, one match is used for an overflow |
| 36 // item. | 36 // item. |
| 37 void ConstructMatches(base::ListValue* metadata_list); | 37 void ConstructMatches(base::ListValue* metadata_list); |
| 38 | 38 |
| 39 // Adds an overflow match item to |matches_| with a relevance score equal to | 39 // Adds an overflow match item to |matches_| with a relevance score equal to |
| 40 // |relevance| and a label indicating there are |additional_url_count| more | 40 // |relevance| and a label indicating there are |additional_url_count| more |
| 41 // nearby URLs. Selecting the overflow item navigates to the Physical Web | 41 // nearby URLs. The page |title| of one of the additional nearby URLs will be |
| 42 // WebUI, which displays the full list of nearby URLs. | 42 // included in the label, truncating if necessary. Selecting the overflow item |
| 43 void AppendOverflowItem(int additional_url_count, int relevance); | 43 // navigates to the Physical Web WebUI, which displays the full list of nearby |
| 44 // URLs. |
| 45 void AppendOverflowItem(int additional_url_count, |
| 46 int relevance, |
| 47 const base::string16& title); |
| 44 | 48 |
| 45 AutocompleteProviderClient* client_; | 49 AutocompleteProviderClient* client_; |
| 46 | 50 |
| 47 // Used for efficiency when creating the verbatim match. Can be null. | 51 // Used for efficiency when creating the verbatim match. Can be null. |
| 48 HistoryURLProvider* history_url_provider_; | 52 HistoryURLProvider* history_url_provider_; |
| 49 | 53 |
| 50 DISALLOW_COPY_AND_ASSIGN(PhysicalWebProvider); | 54 DISALLOW_COPY_AND_ASSIGN(PhysicalWebProvider); |
| 51 }; | 55 }; |
| 52 | 56 |
| 53 #endif // COMPONENTS_OMNIBOX_BROWSER_PHYSICAL_WEB_PROVIDER_H_ | 57 #endif // COMPONENTS_OMNIBOX_BROWSER_PHYSICAL_WEB_PROVIDER_H_ |
| OLD | NEW |