Commit cec11b6f authored by cco3's avatar cco3 Committed by Commit bot

Add Physical Web omnibox support for Android

This adds some degree of feature parity with iOS, which also has a
Physical Web omnibox completion and zero-suggest feature.

BUG=663842

Review-Url: https://codereview.chromium.org/2604243002
Cr-Commit-Position: refs/heads/master@{#442024}
parent 09884bee
......@@ -185,7 +185,9 @@ void AutocompleteControllerAndroid::OnOmniboxFocused(
// If omnibox text is empty, set it to the current URL for the purposes of
// populating the verbatim match.
if (omnibox_text.empty())
if (omnibox_text.empty() &&
!current_url.SchemeIs(content::kChromeUIScheme) &&
!current_url.SchemeIs(chrome::kChromeUINativeScheme))
omnibox_text = url;
input_ = AutocompleteInput(
......
......@@ -17,6 +17,7 @@
#include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service.h"
#include "chrome/browser/bitmap_fetcher/bitmap_fetcher_service_factory.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/history/top_sites_factory.h"
......@@ -153,7 +154,7 @@ ChromeAutocompleteProviderClient::GetKeywordExtensionsDelegate(
physical_web::PhysicalWebDataSource*
ChromeAutocompleteProviderClient::GetPhysicalWebDataSource() {
return nullptr;
return g_browser_process->GetPhysicalWebDataSource();
}
std::string ChromeAutocompleteProviderClient::GetAcceptLanguages() const {
......
......@@ -17,8 +17,11 @@
// static
const int AutocompleteClassifier::kDefaultOmniboxProviders =
#if !defined(OS_ANDROID) && !defined(OS_IOS)
// Custom search engines cannot be used on mobile..
#if defined(OS_ANDROID) || defined(OS_IOS)
// 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 |
#endif
#if !defined(OS_IOS)
......@@ -29,8 +32,6 @@ const int AutocompleteClassifier::kDefaultOmniboxProviders =
#else
// "URL from clipboard" can only be used on iOS.
AutocompleteProvider::TYPE_CLIPBOARD_URL |
// Physical Web omnibox results are only implemented on iOS.
AutocompleteProvider::TYPE_PHYSICAL_WEB |
#endif
AutocompleteProvider::TYPE_BOOKMARK |
AutocompleteProvider::TYPE_HISTORY_QUICK |
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment