| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" | 5 #include "chrome/browser/autocomplete/shortcuts_backend_factory.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "chrome/browser/history/history_service_factory.h" | 10 #include "chrome/browser/history/history_service_factory.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 bool suppress_db) { | 94 bool suppress_db) { |
| 95 scoped_refptr<ShortcutsBackend> backend(new ShortcutsBackend( | 95 scoped_refptr<ShortcutsBackend> backend(new ShortcutsBackend( |
| 96 TemplateURLServiceFactory::GetForProfile(profile), | 96 TemplateURLServiceFactory::GetForProfile(profile), |
| 97 base::MakeUnique<UIThreadSearchTermsData>(profile), | 97 base::MakeUnique<UIThreadSearchTermsData>(profile), |
| 98 HistoryServiceFactory::GetForProfile(profile, | 98 HistoryServiceFactory::GetForProfile(profile, |
| 99 ServiceAccessType::EXPLICIT_ACCESS), | 99 ServiceAccessType::EXPLICIT_ACCESS), |
| 100 content::BrowserThread::GetTaskRunnerForThread( | 100 content::BrowserThread::GetTaskRunnerForThread( |
| 101 content::BrowserThread::DB), | 101 content::BrowserThread::DB), |
| 102 profile->GetPath().Append(kShortcutsDatabaseName), suppress_db)); | 102 profile->GetPath().Append(kShortcutsDatabaseName), suppress_db)); |
| 103 #if BUILDFLAG(ENABLE_EXTENSIONS) | 103 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 104 ShortcutsExtensionsManager* extensions_manager = | 104 auto extensions_manager = |
| 105 new ShortcutsExtensionsManager(profile); | 105 base::MakeUnique<ShortcutsExtensionsManager>(profile); |
| 106 profile->SetUserData(kShortcutsExtensionsManagerKey, extensions_manager); | 106 profile->SetUserData(kShortcutsExtensionsManagerKey, |
| 107 std::move(extensions_manager)); |
| 107 #endif | 108 #endif |
| 108 return backend->Init() ? backend : nullptr; | 109 return backend->Init() ? backend : nullptr; |
| 109 } | 110 } |
| OLD | NEW |