Chromium Code Reviews| 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" | |
| 11 #include "chrome/browser/history/history_service_factory.h" | 10 #include "chrome/browser/history/history_service_factory.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/search_engines/template_url_service_factory.h" | 12 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 14 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" | 13 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
| 15 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 14 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 16 #include "components/omnibox/browser/shortcuts_backend.h" | 15 #include "components/omnibox/browser/shortcuts_backend.h" |
| 17 #include "components/omnibox/browser/shortcuts_constants.h" | 16 #include "components/omnibox/browser/shortcuts_constants.h" |
| 18 #include "components/prefs/pref_service.h" | 17 #include "components/prefs/pref_service.h" |
| 19 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
| 20 #include "extensions/features/features.h" | 19 #include "extensions/features/features.h" |
| 21 | 20 |
| 21 #if BUILDFLAG(ENABLE_EXTENSIONS) | |
|
Peter Kasting
2017/03/30 23:35:31
Nit: Have one #if cover the #include here and the
limasdf
2017/03/31 03:26:27
Done.
| |
| 22 #include "chrome/browser/autocomplete/shortcuts_extensions_manager.h" | |
| 23 #endif | |
| 24 | |
| 22 namespace { | 25 namespace { |
| 23 #if BUILDFLAG(ENABLE_EXTENSIONS) | 26 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 24 const char kShortcutsExtensionsManagerKey[] = "ShortcutsExtensionsManager"; | 27 const char kShortcutsExtensionsManagerKey[] = "ShortcutsExtensionsManager"; |
| 25 #endif | 28 #endif |
| 26 } | 29 } |
| 27 | 30 |
| 28 // static | 31 // static |
| 29 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfile( | 32 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfile( |
| 30 Profile* profile) { | 33 Profile* profile) { |
| 31 return static_cast<ShortcutsBackend*>( | 34 return static_cast<ShortcutsBackend*>( |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 content::BrowserThread::GetTaskRunnerForThread( | 102 content::BrowserThread::GetTaskRunnerForThread( |
| 100 content::BrowserThread::DB), | 103 content::BrowserThread::DB), |
| 101 profile->GetPath().Append(kShortcutsDatabaseName), suppress_db)); | 104 profile->GetPath().Append(kShortcutsDatabaseName), suppress_db)); |
| 102 #if BUILDFLAG(ENABLE_EXTENSIONS) | 105 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 103 ShortcutsExtensionsManager* extensions_manager = | 106 ShortcutsExtensionsManager* extensions_manager = |
| 104 new ShortcutsExtensionsManager(profile); | 107 new ShortcutsExtensionsManager(profile); |
| 105 profile->SetUserData(kShortcutsExtensionsManagerKey, extensions_manager); | 108 profile->SetUserData(kShortcutsExtensionsManagerKey, extensions_manager); |
| 106 #endif | 109 #endif |
| 107 return backend->Init() ? backend : nullptr; | 110 return backend->Init() ? backend : nullptr; |
| 108 } | 111 } |
| OLD | NEW |