| Index: components/omnibox/browser/autocomplete_controller.cc
|
| diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc
|
| index 1a175d428d4d3b574c6fcf544b923948eb85d461..1a6f63e79a9e52c07d0f02204f2c950429313ae0 100644
|
| --- a/components/omnibox/browser/autocomplete_controller.cc
|
| +++ b/components/omnibox/browser/autocomplete_controller.cc
|
| @@ -11,6 +11,7 @@
|
|
|
| #include "base/format_macros.h"
|
| #include "base/logging.h"
|
| +#include "base/memory/ptr_util.h"
|
| #include "base/metrics/histogram.h"
|
| #include "base/strings/string_number_conversions.h"
|
| #include "base/strings/stringprintf.h"
|
| @@ -31,6 +32,7 @@
|
| #include "components/omnibox/browser/shortcuts_provider.h"
|
| #include "components/omnibox/browser/zero_suggest_provider.h"
|
| #include "components/open_from_clipboard/clipboard_recent_content.h"
|
| +#include "components/open_from_clipboard/clipboard_recent_content_generic.h"
|
| #include "components/search_engines/template_url.h"
|
| #include "components/search_engines/template_url_service.h"
|
| #include "components/strings/grit/components_strings.h"
|
| @@ -229,13 +231,18 @@ AutocompleteController::AutocompleteController(
|
| providers_.push_back(zero_suggest_provider_);
|
| }
|
| if (provider_types & AutocompleteProvider::TYPE_CLIPBOARD_URL) {
|
| - ClipboardRecentContent* clipboard_recent_content =
|
| - ClipboardRecentContent::GetInstance();
|
| - if (clipboard_recent_content) {
|
| - providers_.push_back(new ClipboardURLProvider(provider_client_.get(),
|
| - history_url_provider_,
|
| - clipboard_recent_content));
|
| + // On iOS, a global ClipboardRecentContent should've been created by now
|
| + // (if enabled). If none has been created (e.g., we're on a different
|
| + // platform), use the generic implementation, which AutocompleteController
|
| + // will own.
|
| + if (!ClipboardRecentContent::GetInstance()) {
|
| + clipboard_recent_content_ =
|
| + base::MakeUnique<ClipboardRecentContentGeneric>();
|
| + ClipboardRecentContent::SetInstance(clipboard_recent_content_.get());
|
| }
|
| + providers_.push_back(
|
| + new ClipboardURLProvider(provider_client_.get(), history_url_provider_,
|
| + ClipboardRecentContent::GetInstance()));
|
| }
|
| if (provider_types & AutocompleteProvider::TYPE_PHYSICAL_WEB) {
|
| PhysicalWebProvider* physical_web_provider = PhysicalWebProvider::Create(
|
|
|