Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5133)

Unified Diff: chrome/browser/extensions/platform_app_registry.cc

Issue 10119003: Pull shell window stuff out of ExtensionHost and put in ShellWindow (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Mac shell window Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
+}

Powered by Google App Engine
This is Rietveld 408576698