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

Unified Diff: chrome/browser/extensions/shell_window_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: Comments Created 8 years, 7 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/shell_window_registry.cc
diff --git a/chrome/browser/extensions/shell_window_registry.cc b/chrome/browser/extensions/shell_window_registry.cc
new file mode 100644
index 0000000000000000000000000000000000000000..375fb9c467447f8d94d744fdc03932017e2fd7d7
--- /dev/null
+++ b/chrome/browser/extensions/shell_window_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/shell_window_registry.h"
+#include "chrome/browser/profiles/profile_dependency_manager.h"
+
+ShellWindowRegistry::ShellWindowRegistry() {}
+
+ShellWindowRegistry::~ShellWindowRegistry() {}
+
+// static
+ShellWindowRegistry* ShellWindowRegistry::Get(Profile* profile) {
+ return Factory::GetForProfile(profile);
+}
+
+void ShellWindowRegistry::AddShellWindow(ShellWindow* shell_window) {
+ shell_windows_.insert(shell_window);
+}
+
+void ShellWindowRegistry::RemoveShellWindow(ShellWindow* shell_window) {
+ shell_windows_.erase(shell_window);
+}
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Factory boilerplate
+
+// static
+ShellWindowRegistry* ShellWindowRegistry::Factory::GetForProfile(
+ Profile* profile) {
+ return static_cast<ShellWindowRegistry*>(
+ GetInstance()->GetServiceForProfile(profile, true));
+}
+
+ShellWindowRegistry::Factory* ShellWindowRegistry::Factory::GetInstance() {
+ return Singleton<ShellWindowRegistry::Factory>::get();
+}
+
+ShellWindowRegistry::Factory::Factory()
+ : ProfileKeyedServiceFactory("ShellWindowRegistry",
+ ProfileDependencyManager::GetInstance()) {
+}
+
+ShellWindowRegistry::Factory::~Factory() {
+}
+
+ProfileKeyedService* ShellWindowRegistry::Factory::BuildServiceInstanceFor(
+ Profile* profile) const {
+ return new ShellWindowRegistry();
+}
+
+bool ShellWindowRegistry::Factory::ServiceIsCreatedWithProfile() {
+ return true;
+}
+
+bool ShellWindowRegistry::Factory::ServiceIsNULLWhileTesting() {
+ return false;
+}
« no previous file with comments | « chrome/browser/extensions/shell_window_registry.h ('k') | chrome/browser/task_manager/task_manager_resource_providers.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698