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

Side by Side Diff: chrome/browser/instant/instant_service_factory.cc

Issue 12386019: Instant: Use only one hidden WebContents per profile. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 9 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/instant/instant_service_factory.h" 5 #include "chrome/browser/instant/instant_service_factory.h"
6 6
7 #include "chrome/browser/instant/instant_service.h" 7 #include "chrome/browser/instant/instant_service.h"
8 #include "chrome/browser/profiles/profile_dependency_manager.h" 8 #include "chrome/browser/profiles/profile_dependency_manager.h"
9 #include "chrome/browser/search_engines/template_url_service_factory.h"
10 #include "chrome/browser/themes/theme_service_factory.h"
9 11
10 // static 12 // static
11 InstantService* InstantServiceFactory::GetForProfile(Profile* profile) { 13 InstantService* InstantServiceFactory::GetForProfile(Profile* profile) {
12 return static_cast<InstantService*>( 14 return static_cast<InstantService*>(
13 GetInstance()->GetServiceForProfile(profile, true)); 15 GetInstance()->GetServiceForProfile(profile, true));
14 } 16 }
15 17
16 // static 18 // static
17 InstantServiceFactory* InstantServiceFactory::GetInstance() { 19 InstantServiceFactory* InstantServiceFactory::GetInstance() {
18 return Singleton<InstantServiceFactory>::get(); 20 return Singleton<InstantServiceFactory>::get();
19 } 21 }
20 22
21 InstantServiceFactory::InstantServiceFactory() 23 InstantServiceFactory::InstantServiceFactory()
22 : ProfileKeyedServiceFactory("InstantService", 24 : ProfileKeyedServiceFactory("InstantService",
23 ProfileDependencyManager::GetInstance()) { 25 ProfileDependencyManager::GetInstance()) {
24 // No dependencies. 26 DependsOn(TemplateURLServiceFactory::GetInstance());
27 DependsOn(ThemeServiceFactory::GetInstance());
25 } 28 }
26 29
27 InstantServiceFactory::~InstantServiceFactory() { 30 InstantServiceFactory::~InstantServiceFactory() {
28 } 31 }
29 32
30 bool InstantServiceFactory::ServiceRedirectedInIncognito() const { 33 bool InstantServiceFactory::ServiceRedirectedInIncognito() const {
31 return true; 34 return true;
32 } 35 }
33 36
34 ProfileKeyedService* InstantServiceFactory::BuildServiceInstanceFor( 37 ProfileKeyedService* InstantServiceFactory::BuildServiceInstanceFor(
35 Profile* profile) const { 38 Profile* profile) const {
36 return new InstantService(profile); 39 return new InstantService(profile);
37 } 40 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698