| 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;
|
| +}
|
|
|