Index: chrome/browser/extensions/platform_app_registry.cc |
diff --git a/chrome/browser/extensions/platform_app_registry.cc b/chrome/browser/extensions/platform_app_registry.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d5fe91f406c60efc11d5366c52bce4c2b0dc8ede |
--- /dev/null |
+++ b/chrome/browser/extensions/platform_app_registry.cc |
@@ -0,0 +1,59 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/extensions/platform_app_registry.h" |
+#include "chrome/browser/profiles/profile_dependency_manager.h" |
+ |
+PlatformAppRegistry::PlatformAppRegistry() {} |
+ |
+PlatformAppRegistry::~PlatformAppRegistry() {} |
+ |
+// static |
+PlatformAppRegistry* PlatformAppRegistry::Get(Profile* profile) { |
+ return Factory::GetForProfile(profile); |
+} |
+ |
+void PlatformAppRegistry::AddShellWindow(ShellWindow* shell_window) { |
+ shell_windows_.insert(shell_window); |
+} |
+ |
+void PlatformAppRegistry::RemoveShellWindow(ShellWindow* shell_window) { |
+ shell_windows_.erase(shell_window); |
+} |
+ |
+ |
+/////////////////////////////////////////////////////////////////////////////// |
+// Factory boilerplate |
+ |
+// static |
+PlatformAppRegistry* PlatformAppRegistry::Factory::GetForProfile( |
+ Profile* profile) { |
+ return static_cast<PlatformAppRegistry*>( |
+ GetInstance()->GetServiceForProfile(profile, true)); |
+} |
+ |
+PlatformAppRegistry::Factory* PlatformAppRegistry::Factory::GetInstance() { |
+ return Singleton<PlatformAppRegistry::Factory>::get(); |
+} |
+ |
+PlatformAppRegistry::Factory::Factory() |
+ : ProfileKeyedServiceFactory("PlatformAppRegistry", |
+ ProfileDependencyManager::GetInstance()) { |
+} |
+ |
+PlatformAppRegistry::Factory::~Factory() { |
+} |
+ |
+ProfileKeyedService* PlatformAppRegistry::Factory::BuildServiceInstanceFor( |
+ Profile* profile) const { |
+ return new PlatformAppRegistry(); |
+} |
+ |
+bool PlatformAppRegistry::Factory::ServiceIsCreatedWithProfile() { |
+ return true; |
+} |
+ |
+bool PlatformAppRegistry::Factory::ServiceIsNULLWhileTesting() { |
+ return false; |
+} |