Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(371)

Unified Diff: components/omnibox/browser/autocomplete_controller.cc

Issue 2801813003: Omnibox - ClipboardRecentContent - Make Proper Singleton (Closed)
Patch Set: jif@'s suggestion Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/omnibox/browser/autocomplete_controller.cc
diff --git a/components/omnibox/browser/autocomplete_controller.cc b/components/omnibox/browser/autocomplete_controller.cc
index ccbdfd3d0d1059d4ff3af027e8001ba2f80abb75..33c848eec0b433db643504453956c29af4cfb6b3 100644
--- a/components/omnibox/browser/autocomplete_controller.cc
+++ b/components/omnibox/browser/autocomplete_controller.cc
@@ -5,6 +5,7 @@
#include "components/omnibox/browser/autocomplete_controller.h"
#include <stddef.h>
+#include <memory>
#include <set>
#include <string>
#include <utility>
@@ -32,14 +33,15 @@
#include "components/omnibox/browser/shortcuts_provider.h"
#include "components/omnibox/browser/zero_suggest_provider.h"
#include "components/open_from_clipboard/clipboard_recent_content.h"
-#if !defined(OS_IOS)
-#include "components/open_from_clipboard/clipboard_recent_content_generic.h"
-#endif
#include "components/search_engines/template_url.h"
#include "components/search_engines/template_url_service.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
+#if !defined(OS_IOS)
+#include "components/open_from_clipboard/clipboard_recent_content_generic.h"
+#endif
+
namespace {
// Converts the given match to a type (and possibly subtype) based on the AQS
@@ -241,9 +243,8 @@ AutocompleteController::AutocompleteController(
// iOS doesn't want/need to link in the implementation and the libraries
// that would come with it.
if (!ClipboardRecentContent::GetInstance()) {
- clipboard_recent_content_ =
- base::MakeUnique<ClipboardRecentContentGeneric>();
- ClipboardRecentContent::SetInstance(clipboard_recent_content_.get());
+ ClipboardRecentContent::SetInstance(
+ std::unique_ptr<ClipboardRecentContentGeneric>());
Peter Kasting 2017/04/10 21:59:22 Doesn't this fail to actually create the underlyin
Mark P 2017/04/10 22:05:22 Right you are. :-) Done. (I didn't bother testin
}
#endif
// ClipboardRecentContent can be null in iOS tests. For non-iOS, we

Powered by Google App Engine
This is Rietveld 408576698