Chromium Code Reviews| Index: components/omnibox/browser/physical_web_provider.h |
| diff --git a/components/omnibox/browser/physical_web_provider.h b/components/omnibox/browser/physical_web_provider.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..8933ae9d0a7027caa557fe056ad7f1dd752d4c72 |
| --- /dev/null |
| +++ b/components/omnibox/browser/physical_web_provider.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef COMPONENTS_OMNIBOX_BROWSER_PHYSICAL_WEB_PROVIDER_H_ |
| +#define COMPONENTS_OMNIBOX_BROWSER_PHYSICAL_WEB_PROVIDER_H_ |
| + |
| +#include "components/omnibox/browser/autocomplete_input.h" |
| +#include "components/omnibox/browser/autocomplete_provider.h" |
| + |
| +class AutocompleteProviderClient; |
| + |
| +namespace base { |
| +class ListValue; |
| +} |
| + |
| +class PhysicalWebProvider : public AutocompleteProvider { |
| +public: |
| + static PhysicalWebProvider* Create(AutocompleteProviderClient* client); |
| + |
| + // AutocompleteProvider: |
| + void Start(const AutocompleteInput& input, bool minimal_changes) override; |
| + void Stop(bool clear_cached_results, bool due_to_user_inactivity) override; |
| + |
| +private: |
| + PhysicalWebProvider(AutocompleteProviderClient* client); |
| + ~PhysicalWebProvider() override; |
| + |
| + // Adds a separate match item for each nearby URL, up to the maximum number of |
| + // 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.
|
| + // 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
|
| + void ConstructMatches(base::ListValue* metadata_list); |
| + |
| + // Adds an overflow match item when the number of nearby URLs exceeds the |
| + // 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
|
| + // item navigates to the Physical Web WebUI, which displays the full list of |
| + // nearby URLs. |
| + void AppendOverflowItemIfNecessary(base::ListValue* metadata_list); |
| + |
| + AutocompleteProviderClient* client_; |
| +}; |
| + |
| +#endif // COMPONENTS_OMNIBOX_BROWSER_PHYSICAL_WEB_PROVIDER_H_ |