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

Side by Side Diff: chrome/browser/android/offline_pages/offline_page_model_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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/android/offline_pages/offline_page_model_factory.h" 5 #include "chrome/browser/android/offline_pages/offline_page_model_factory.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/memory/singleton.h" 8 #include "base/memory/singleton.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/sequenced_task_runner.h" 10 #include "base/sequenced_task_runner.h"
(...skipping 10 matching lines...) Expand all
21 namespace offline_pages { 21 namespace offline_pages {
22 22
23 OfflinePageModelFactory::OfflinePageModelFactory() 23 OfflinePageModelFactory::OfflinePageModelFactory()
24 : BrowserContextKeyedServiceFactory( 24 : BrowserContextKeyedServiceFactory(
25 "OfflinePageModel", 25 "OfflinePageModel",
26 BrowserContextDependencyManager::GetInstance()) { 26 BrowserContextDependencyManager::GetInstance()) {
27 } 27 }
28 28
29 // static 29 // static
30 OfflinePageModelFactory* OfflinePageModelFactory::GetInstance() { 30 OfflinePageModelFactory* OfflinePageModelFactory::GetInstance() {
31 return Singleton<OfflinePageModelFactory>::get(); 31 return base::Singleton<OfflinePageModelFactory>::get();
32 } 32 }
33 33
34 // static 34 // static
35 OfflinePageModel* OfflinePageModelFactory::GetForBrowserContext( 35 OfflinePageModel* OfflinePageModelFactory::GetForBrowserContext(
36 content::BrowserContext* context) { 36 content::BrowserContext* context) {
37 if (context->IsOffTheRecord()) 37 if (context->IsOffTheRecord())
38 return nullptr; 38 return nullptr;
39 39
40 return static_cast<OfflinePageModel*>( 40 return static_cast<OfflinePageModel*>(
41 GetInstance()->GetServiceForBrowserContext(context, true)); 41 GetInstance()->GetServiceForBrowserContext(context, true));
(...skipping 19 matching lines...) Expand all
61 return new OfflinePageModel(metadata_store.Pass(), background_task_runner); 61 return new OfflinePageModel(metadata_store.Pass(), background_task_runner);
62 } 62 }
63 63
64 content::BrowserContext* OfflinePageModelFactory::GetBrowserContextToUse( 64 content::BrowserContext* OfflinePageModelFactory::GetBrowserContextToUse(
65 content::BrowserContext* context) const { 65 content::BrowserContext* context) const {
66 return chrome::GetBrowserContextRedirectedInIncognito(context); 66 return chrome::GetBrowserContextRedirectedInIncognito(context);
67 } 67 }
68 68
69 } // namespace offline_pages 69 } // namespace offline_pages
70 70
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698