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

Side by Side Diff: chrome/browser/prerender/prerender_manager_factory.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 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
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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/prerender/prerender_manager_factory.h" 5 #include "chrome/browser/prerender/prerender_manager_factory.h"
6 6
7 #include "base/sys_info.h" 7 #include "base/sys_info.h"
8 #include "base/trace_event/trace_event.h" 8 #include "base/trace_event/trace_event.h"
9 #include "chrome/browser/browser_process.h" 9 #include "chrome/browser/browser_process.h"
10 #include "chrome/browser/history/history_service_factory.h" 10 #include "chrome/browser/history/history_service_factory.h"
(...skipping 16 matching lines...) Expand all
27 Profile* profile) { 27 Profile* profile) {
28 TRACE_EVENT0("browser", "PrerenderManagerFactory::GetForProfile") 28 TRACE_EVENT0("browser", "PrerenderManagerFactory::GetForProfile")
29 if (!PrerenderManager::IsPrerenderingPossible()) 29 if (!PrerenderManager::IsPrerenderingPossible())
30 return NULL; 30 return NULL;
31 return static_cast<PrerenderManager*>( 31 return static_cast<PrerenderManager*>(
32 GetInstance()->GetServiceForBrowserContext(profile, true)); 32 GetInstance()->GetServiceForBrowserContext(profile, true));
33 } 33 }
34 34
35 // static 35 // static
36 PrerenderManagerFactory* PrerenderManagerFactory::GetInstance() { 36 PrerenderManagerFactory* PrerenderManagerFactory::GetInstance() {
37 return Singleton<PrerenderManagerFactory>::get(); 37 return base::Singleton<PrerenderManagerFactory>::get();
38 } 38 }
39 39
40 PrerenderManagerFactory::PrerenderManagerFactory() 40 PrerenderManagerFactory::PrerenderManagerFactory()
41 : BrowserContextKeyedServiceFactory( 41 : BrowserContextKeyedServiceFactory(
42 "PrerenderManager", 42 "PrerenderManager",
43 BrowserContextDependencyManager::GetInstance()) { 43 BrowserContextDependencyManager::GetInstance()) {
44 #if defined(ENABLE_EXTENSIONS) 44 #if defined(ENABLE_EXTENSIONS)
45 DependsOn( 45 DependsOn(
46 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); 46 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
47 #endif 47 #endif
(...skipping 14 matching lines...) Expand all
62 62
63 return new PrerenderManager(profile); 63 return new PrerenderManager(profile);
64 } 64 }
65 65
66 content::BrowserContext* PrerenderManagerFactory::GetBrowserContextToUse( 66 content::BrowserContext* PrerenderManagerFactory::GetBrowserContextToUse(
67 content::BrowserContext* context) const { 67 content::BrowserContext* context) const {
68 return chrome::GetBrowserContextOwnInstanceInIncognito(context); 68 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
69 } 69 }
70 70
71 } // namespace prerender 71 } // namespace prerender
OLDNEW
« no previous file with comments | « chrome/browser/prerender/prerender_manager_factory.h ('k') | chrome/browser/prerender/prerender_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698