OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/extensions/platform_app_registry.h" |
| 6 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 7 |
| 8 PlatformAppRegistry::~PlatformAppRegistry() {} |
| 9 |
| 10 // static |
| 11 PlatformAppRegistry* PlatformAppRegistry::Get(Profile* profile) { |
| 12 return Factory::GetForProfile(profile); |
| 13 } |
| 14 |
| 15 void PlatformAppRegistry::AddShellWindow(ShellWindow* shell_window) { |
| 16 shell_windows_.insert(shell_window); |
| 17 } |
| 18 |
| 19 void PlatformAppRegistry::RemoveShellWindow(ShellWindow* shell_window) { |
| 20 shell_windows_.erase(shell_window); |
| 21 } |
| 22 |
| 23 |
| 24 /////////////////////////////////////////////////////////////////////////////// |
| 25 // Factory boilerplate |
| 26 |
| 27 // static |
| 28 PlatformAppRegistry* PlatformAppRegistry::Factory::GetForProfile( |
| 29 Profile* profile) { |
| 30 return static_cast<PlatformAppRegistry*>( |
| 31 GetInstance()->GetServiceForProfile(profile, true)); |
| 32 } |
| 33 |
| 34 PlatformAppRegistry::Factory* PlatformAppRegistry::Factory::GetInstance() { |
| 35 return Singleton<PlatformAppRegistry::Factory>::get(); |
| 36 } |
| 37 |
| 38 PlatformAppRegistry::Factory::Factory() |
| 39 : ProfileKeyedServiceFactory("PlatformAppRegistry", |
| 40 ProfileDependencyManager::GetInstance()) { |
| 41 } |
| 42 |
| 43 PlatformAppRegistry::Factory::~Factory() { |
| 44 } |
| 45 |
| 46 ProfileKeyedService* PlatformAppRegistry::Factory::BuildServiceInstanceFor( |
| 47 Profile* profile) const { |
| 48 return new PlatformAppRegistry(); |
| 49 } |
| 50 |
| 51 bool PlatformAppRegistry::Factory::ServiceIsCreatedWithProfile() { |
| 52 return true; |
| 53 } |
| 54 |
| 55 bool PlatformAppRegistry::Factory::ServiceIsNULLWhileTesting() { |
| 56 return false; |
| 57 } |
OLD | NEW |