1 // Copyright 2013 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. 4 5 #include "chrome/browser/apps/shortcut_manager_factory.h" 6 7 #include "chrome/browser/apps/shortcut_manager.h" 8 #include "chrome/browser/profiles/profile.h" 9 #include "components/browser_context_keyed_service/browser_context_dependency_manager.h" 10 11 // static 12 AppShortcutManager* AppShortcutManagerFactory::GetForProfile(Profile* profile) { 13 return static_cast<AppShortcutManager*>( 14 GetInstance()->GetServiceForBrowserContext(profile, true)); 15 } 16 17 AppShortcutManagerFactory* AppShortcutManagerFactory::GetInstance() { 18 return Singleton<AppShortcutManagerFactory>::get(); 19 } 20 21 AppShortcutManagerFactory::AppShortcutManagerFactory() 22 : BrowserContextKeyedServiceFactory( 23 "AppShortcutManager", 24 BrowserContextDependencyManager::GetInstance()) { 25 } 26 27 AppShortcutManagerFactory::~AppShortcutManagerFactory() { 28 } 29 30 BrowserContextKeyedService* AppShortcutManagerFactory::BuildServiceInstanceFor( 31 content::BrowserContext* profile) const { 32 return new AppShortcutManager(static_cast<Profile*>(profile)); 33 } 34 35 bool AppShortcutManagerFactory::ServiceIsCreatedWithBrowserContext() const { 36 return true; 37 } 38