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/autocomplete/shortcuts_extensions_manager.h" | 10 #include "chrome/browser/autocomplete/shortcuts_extensions_manager.h" |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 | 88 |
89 // static | 89 // static |
90 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::CreateShortcutsBackend( | 90 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::CreateShortcutsBackend( |
91 Profile* profile, | 91 Profile* profile, |
92 bool suppress_db) { | 92 bool suppress_db) { |
93 scoped_refptr<ShortcutsBackend> backend(new ShortcutsBackend( | 93 scoped_refptr<ShortcutsBackend> backend(new ShortcutsBackend( |
94 TemplateURLServiceFactory::GetForProfile(profile), | 94 TemplateURLServiceFactory::GetForProfile(profile), |
95 base::WrapUnique(new UIThreadSearchTermsData(profile)), | 95 base::WrapUnique(new UIThreadSearchTermsData(profile)), |
96 HistoryServiceFactory::GetForProfile(profile, | 96 HistoryServiceFactory::GetForProfile(profile, |
97 ServiceAccessType::EXPLICIT_ACCESS), | 97 ServiceAccessType::EXPLICIT_ACCESS), |
98 content::BrowserThread::GetMessageLoopProxyForThread( | 98 content::BrowserThread::GetTaskRunnerForThread( |
99 content::BrowserThread::DB), | 99 content::BrowserThread::DB), |
100 profile->GetPath().Append(kShortcutsDatabaseName), suppress_db)); | 100 profile->GetPath().Append(kShortcutsDatabaseName), suppress_db)); |
101 #if defined(ENABLE_EXTENSIONS) | 101 #if defined(ENABLE_EXTENSIONS) |
102 ShortcutsExtensionsManager* extensions_manager = | 102 ShortcutsExtensionsManager* extensions_manager = |
103 new ShortcutsExtensionsManager(profile); | 103 new ShortcutsExtensionsManager(profile); |
104 profile->SetUserData(kShortcutsExtensionsManagerKey, extensions_manager); | 104 profile->SetUserData(kShortcutsExtensionsManagerKey, extensions_manager); |
105 #endif | 105 #endif |
106 return backend->Init() ? backend : nullptr; | 106 return backend->Init() ? backend : nullptr; |
107 } | 107 } |
OLD | NEW |