| 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 "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/prefs/pref_service.h" | |
| 9 #include "chrome/browser/autocomplete/shortcuts_extensions_manager.h" | 8 #include "chrome/browser/autocomplete/shortcuts_extensions_manager.h" |
| 10 #include "chrome/browser/history/history_service_factory.h" | 9 #include "chrome/browser/history/history_service_factory.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/search_engines/template_url_service_factory.h" | 11 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 13 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" | 12 #include "chrome/browser/search_engines/ui_thread_search_terms_data.h" |
| 14 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 13 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 15 #include "components/omnibox/browser/shortcuts_backend.h" | 14 #include "components/omnibox/browser/shortcuts_backend.h" |
| 16 #include "components/omnibox/browser/shortcuts_constants.h" | 15 #include "components/omnibox/browser/shortcuts_constants.h" |
| 16 #include "components/prefs/pref_service.h" |
| 17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 #if defined(ENABLE_EXTENSIONS) | 20 #if defined(ENABLE_EXTENSIONS) |
| 21 const char kShortcutsExtensionsManagerKey[] = "ShortcutsExtensionsManager"; | 21 const char kShortcutsExtensionsManagerKey[] = "ShortcutsExtensionsManager"; |
| 22 #endif | 22 #endif |
| 23 } | 23 } |
| 24 | 24 |
| 25 // static | 25 // static |
| 26 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfile( | 26 scoped_refptr<ShortcutsBackend> ShortcutsBackendFactory::GetForProfile( |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 content::BrowserThread::GetMessageLoopProxyForThread( | 96 content::BrowserThread::GetMessageLoopProxyForThread( |
| 97 content::BrowserThread::DB), | 97 content::BrowserThread::DB), |
| 98 profile->GetPath().Append(kShortcutsDatabaseName), suppress_db)); | 98 profile->GetPath().Append(kShortcutsDatabaseName), suppress_db)); |
| 99 #if defined(ENABLE_EXTENSIONS) | 99 #if defined(ENABLE_EXTENSIONS) |
| 100 ShortcutsExtensionsManager* extensions_manager = | 100 ShortcutsExtensionsManager* extensions_manager = |
| 101 new ShortcutsExtensionsManager(profile); | 101 new ShortcutsExtensionsManager(profile); |
| 102 profile->SetUserData(kShortcutsExtensionsManagerKey, extensions_manager); | 102 profile->SetUserData(kShortcutsExtensionsManagerKey, extensions_manager); |
| 103 #endif | 103 #endif |
| 104 return backend->Init() ? backend : nullptr; | 104 return backend->Init() ? backend : nullptr; |
| 105 } | 105 } |
| OLD | NEW |