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

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

Powered by Google App Engine
This is Rietveld 408576698