Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef COMPONENTS_OMNIBOX_BROWSER_PHYSICAL_WEB_PROVIDER_H_ | |
| 6 #define COMPONENTS_OMNIBOX_BROWSER_PHYSICAL_WEB_PROVIDER_H_ | |
| 7 | |
| 8 #include "components/omnibox/browser/autocomplete_input.h" | |
| 9 #include "components/omnibox/browser/autocomplete_provider.h" | |
| 10 | |
| 11 class AutocompleteProviderClient; | |
| 12 | |
| 13 namespace base { | |
| 14 class ListValue; | |
| 15 } | |
| 16 | |
| 17 class PhysicalWebProvider : public AutocompleteProvider { | |
| 18 public: | |
| 19 static PhysicalWebProvider* Create(AutocompleteProviderClient* client); | |
| 20 | |
| 21 // AutocompleteProvider: | |
| 22 void Start(const AutocompleteInput& input, bool minimal_changes) override; | |
| 23 void Stop(bool clear_cached_results, bool due_to_user_inactivity) override; | |
| 24 | |
| 25 private: | |
| 26 PhysicalWebProvider(AutocompleteProviderClient* client); | |
| 27 ~PhysicalWebProvider() override; | |
| 28 | |
| 29 // Adds a separate match item for each nearby URL, up to the maximum number of | |
| 30 // matches allowed by this provider. If the total number of nearby URLs | |
|
Mark P
2016/08/10 23:33:21
nit: omit "by this provider"; it doesn't add anyth
Mark P
2016/08/10 23:33:21
First sentence: this should mention where the matc
mattreynolds
2016/08/11 01:25:03
Done.
| |
| 31 // exceeds this limit, one match is reserved for an overflow item. | |
|
Mark P
2016/08/10 23:33:21
nit: "one match" -> "one slot"
(I assume you don't
mattreynolds
2016/08/11 01:25:03
The terminology is confusing since technically the
| |
| 32 void ConstructMatches(base::ListValue* metadata_list); | |
| 33 | |
| 34 // Adds an overflow match item when the number of nearby URLs exceeds the | |
| 35 // maximum number of matches allowed by this provider. Selecting the overflow | |
|
Mark P
2016/08/10 23:33:21
ditto same concerns about unclear what variables a
mattreynolds
2016/08/11 01:25:03
Makes sense, renamed to AppendOverflowItem and mov
| |
| 36 // item navigates to the Physical Web WebUI, which displays the full list of | |
| 37 // nearby URLs. | |
| 38 void AppendOverflowItemIfNecessary(base::ListValue* metadata_list); | |
| 39 | |
| 40 AutocompleteProviderClient* client_; | |
| 41 }; | |
| 42 | |
| 43 #endif // COMPONENTS_OMNIBOX_BROWSER_PHYSICAL_WEB_PROVIDER_H_ | |
| OLD | NEW |