1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/bookmarks/enhanced_bookmark_key_service_factory.h"
7 #include "base/memory/singleton.h"
8 #include "chrome/browser/profiles/incognito_helpers.h"
9 #include "chrome/browser/ui/bookmarks/enhanced_bookmark_key_service.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
13 EnhancedBookmarkKeyServiceFactory
*
14 EnhancedBookmarkKeyServiceFactory::GetInstance() {
15 return base::Singleton
<EnhancedBookmarkKeyServiceFactory
>::get();
18 EnhancedBookmarkKeyServiceFactory::EnhancedBookmarkKeyServiceFactory()
19 : BrowserContextKeyedServiceFactory(
20 "EnhancedBookmarkKeyService",
21 BrowserContextDependencyManager::GetInstance()) {
24 EnhancedBookmarkKeyServiceFactory::~EnhancedBookmarkKeyServiceFactory() {
27 KeyedService
* EnhancedBookmarkKeyServiceFactory::BuildServiceInstanceFor(
28 content::BrowserContext
* context
) const {
29 return new EnhancedBookmarkKeyService(context
);
32 content::BrowserContext
*
33 EnhancedBookmarkKeyServiceFactory::GetBrowserContextToUse(
34 content::BrowserContext
* context
) const {
35 return chrome::GetBrowserContextRedirectedInIncognito(context
);
38 bool EnhancedBookmarkKeyServiceFactory::ServiceIsCreatedWithBrowserContext()
43 bool EnhancedBookmarkKeyServiceFactory::ServiceIsNULLWhileTesting() const {