| Index: components/omnibox/browser/autocomplete_classifier.cc
|
| diff --git a/components/omnibox/browser/autocomplete_classifier.cc b/components/omnibox/browser/autocomplete_classifier.cc
|
| index c6e81cfe9ae2c0dde0b5d51f6d785a8c43973ed0..d06fe9d8369fc5f50a1c441419013f450b8d8899 100644
|
| --- a/components/omnibox/browser/autocomplete_classifier.cc
|
| +++ b/components/omnibox/browser/autocomplete_classifier.cc
|
| @@ -7,36 +7,40 @@
|
| #include <utility>
|
|
|
| #include "base/auto_reset.h"
|
| +#include "base/feature_list.h"
|
| #include "build/build_config.h"
|
| #include "components/metrics/proto/omnibox_event.pb.h"
|
| #include "components/omnibox/browser/autocomplete_controller.h"
|
| #include "components/omnibox/browser/autocomplete_input.h"
|
| #include "components/omnibox/browser/autocomplete_match.h"
|
| #include "components/omnibox/browser/autocomplete_provider.h"
|
| +#include "components/omnibox/browser/omnibox_field_trial.h"
|
| #include "url/gurl.h"
|
|
|
| // static
|
| -const int AutocompleteClassifier::kDefaultOmniboxProviders =
|
| +int AutocompleteClassifier::DefaultOmniboxProviders() {
|
| + return
|
| #if defined(OS_ANDROID) || defined(OS_IOS)
|
| - // The Physical Web currently is only implemented on mobile devices.
|
| - AutocompleteProvider::TYPE_PHYSICAL_WEB |
|
| + // The Physical Web currently is only implemented on mobile devices.
|
| + AutocompleteProvider::TYPE_PHYSICAL_WEB |
|
| #else
|
| - // Custom search engines cannot be used on mobile.
|
| - AutocompleteProvider::TYPE_KEYWORD |
|
| + // Custom search engines cannot be used on mobile.
|
| + AutocompleteProvider::TYPE_KEYWORD |
|
| #endif
|
| #if !defined(OS_IOS)
|
| - // "Builtin", "Shortcuts" and "Zero Suggest" are not supported on iOS.
|
| - AutocompleteProvider::TYPE_BUILTIN |
|
| - AutocompleteProvider::TYPE_SHORTCUTS |
|
| - AutocompleteProvider::TYPE_ZERO_SUGGEST |
|
| -#else
|
| - // "URL from clipboard" can only be used on iOS.
|
| - AutocompleteProvider::TYPE_CLIPBOARD_URL |
|
| + // "Builtin", "Shortcuts" and "Zero Suggest" are not supported on iOS.
|
| + AutocompleteProvider::TYPE_BUILTIN |
|
| + AutocompleteProvider::TYPE_SHORTCUTS |
|
| + AutocompleteProvider::TYPE_ZERO_SUGGEST |
|
| #endif
|
| - AutocompleteProvider::TYPE_BOOKMARK |
|
| - AutocompleteProvider::TYPE_HISTORY_QUICK |
|
| - AutocompleteProvider::TYPE_HISTORY_URL |
|
| - AutocompleteProvider::TYPE_SEARCH;
|
| + (base::FeatureList::IsEnabled(omnibox::kEnableClipboardProvider)
|
| + ? AutocompleteProvider::TYPE_CLIPBOARD_URL
|
| + : 0) |
|
| + AutocompleteProvider::TYPE_BOOKMARK |
|
| + AutocompleteProvider::TYPE_HISTORY_QUICK |
|
| + AutocompleteProvider::TYPE_HISTORY_URL |
|
| + AutocompleteProvider::TYPE_SEARCH;
|
| +}
|
|
|
| AutocompleteClassifier::AutocompleteClassifier(
|
| std::unique_ptr<AutocompleteController> controller,
|
|
|