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

Side by Side Diff: chrome/browser/tabs/pinned_tab_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
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/tabs/pinned_tab_service_factory.h" 5 #include "chrome/browser/tabs/pinned_tab_service_factory.h"
6 6
7 #include "chrome/browser/tabs/pinned_tab_service.h" 7 #include "chrome/browser/tabs/pinned_tab_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/profiles/profile_dependency_manager.h" 9 #include "chrome/browser/profiles/profile_dependency_manager.h"
10 10
11 // static 11 // static
12 PinnedTabService* PinnedTabServiceFactory::GetForProfile( 12 PinnedTabService* PinnedTabServiceFactory::GetForProfile(
13 Profile* profile) { 13 Profile* profile) {
14 return static_cast<PinnedTabService*>( 14 return static_cast<PinnedTabService*>(
15 GetInstance()->GetServiceForProfile(profile)); 15 GetInstance()->GetServiceForProfile(profile, true));
16 } 16 }
17 17
18 PinnedTabServiceFactory* PinnedTabServiceFactory::GetInstance() { 18 PinnedTabServiceFactory* PinnedTabServiceFactory::GetInstance() {
19 return Singleton<PinnedTabServiceFactory>::get(); 19 return Singleton<PinnedTabServiceFactory>::get();
20 } 20 }
21 21
22 PinnedTabServiceFactory::PinnedTabServiceFactory() 22 PinnedTabServiceFactory::PinnedTabServiceFactory()
23 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) { 23 : ProfileKeyedServiceFactory(ProfileDependencyManager::GetInstance()) {
24 } 24 }
25 25
26 PinnedTabServiceFactory::~PinnedTabServiceFactory() { 26 PinnedTabServiceFactory::~PinnedTabServiceFactory() {
27 } 27 }
28 28
29 ProfileKeyedService* PinnedTabServiceFactory::BuildServiceInstanceFor( 29 ProfileKeyedService* PinnedTabServiceFactory::BuildServiceInstanceFor(
30 Profile* profile) const { 30 Profile* profile) const {
31 return new PinnedTabService(profile); 31 return new PinnedTabService(profile);
32 } 32 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_keyed_service_factory.cc ('k') | chrome/browser/themes/theme_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698