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

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