Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / bookmarks / enhanced_bookmark_key_service_factory.cc
blob36d71c4b084dcf95a4476d20fe34e4090bf91982
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"
12 // static
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()
39 const {
40 return true;
43 bool EnhancedBookmarkKeyServiceFactory::ServiceIsNULLWhileTesting() const {
44 return true;