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

Side by Side Diff: chrome/browser/background_contents_service_factory.cc

Issue 6879031: Add optional creation to ProfileKeyedServiceFactory. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add docs for new parameter Created 9 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/background_mode_manager_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/background_contents_service_factory.h" 5 #include "chrome/browser/background_contents_service_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/background_contents_service.h" 8 #include "chrome/browser/background_contents_service.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/profiles/profile_dependency_manager.h" 10 #include "chrome/browser/profiles/profile_dependency_manager.h"
11 11
12 // static 12 // static
13 BackgroundContentsService* BackgroundContentsServiceFactory::GetForProfile( 13 BackgroundContentsService* BackgroundContentsServiceFactory::GetForProfile(
14 Profile* profile) { 14 Profile* profile) {
15 return static_cast<BackgroundContentsService*>( 15 return static_cast<BackgroundContentsService*>(
16 GetInstance()->GetServiceForProfile(profile)); 16 GetInstance()->GetServiceForProfile(profile, true));
17 } 17 }
18 18
19 // static 19 // static
20 BackgroundContentsServiceFactory* BackgroundContentsServiceFactory:: 20 BackgroundContentsServiceFactory* BackgroundContentsServiceFactory::
21 GetInstance() { 21 GetInstance() {
22 return Singleton<BackgroundContentsServiceFactory>::get(); 22 return Singleton<BackgroundContentsServiceFactory>::get();
23 } 23 }
24 24
25 BackgroundContentsServiceFactory::BackgroundContentsServiceFactory() 25 BackgroundContentsServiceFactory::BackgroundContentsServiceFactory()
26 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { 26 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
27 } 27 }
28 28
29 BackgroundContentsServiceFactory::~BackgroundContentsServiceFactory() { 29 BackgroundContentsServiceFactory::~BackgroundContentsServiceFactory() {
30 } 30 }
31 31
32 ProfileKeyedService* BackgroundContentsServiceFactory::BuildServiceInstanceFor( 32 ProfileKeyedService* BackgroundContentsServiceFactory::BuildServiceInstanceFor(
33 Profile* profile) const { 33 Profile* profile) const {
34 return new BackgroundContentsService(profile, 34 return new BackgroundContentsService(profile,
35 CommandLine::ForCurrentProcess()); 35 CommandLine::ForCurrentProcess());
36 } 36 }
37 37
38 bool BackgroundContentsServiceFactory::ServiceHasOwnInstanceInIncognito() { 38 bool BackgroundContentsServiceFactory::ServiceHasOwnInstanceInIncognito() {
39 return true; 39 return true;
40 } 40 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/background_mode_manager_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698