OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "chrome/browser/feedback/feedback_uploader_factory.h" | |
6 | |
7 #include "base/memory/singleton.h" | |
8 #include "chrome/browser/feedback/feedback_uploader.h" | |
9 #include "chrome/browser/feedback/feedback_uploader_chrome.h" | |
10 #include "chrome/browser/profiles/incognito_helpers.h" | |
11 #include "components/keyed_service/content/browser_context_dependency_manager.h" | |
12 | |
13 namespace feedback { | |
14 | |
15 // static | |
16 FeedbackUploaderFactory* FeedbackUploaderFactory::GetInstance() { | |
17 return Singleton<FeedbackUploaderFactory>::get(); | |
18 } | |
19 | |
20 // static | |
21 FeedbackUploader* FeedbackUploaderFactory::GetForBrowserContext( | |
22 content::BrowserContext* context) { | |
23 return static_cast<FeedbackUploaderChrome*>( | |
24 GetInstance()->GetServiceForBrowserContext(context, true)); | |
25 } | |
26 | |
27 FeedbackUploaderFactory::FeedbackUploaderFactory() | |
28 : BrowserContextKeyedServiceFactory( | |
29 "feedback::FeedbackUploader", | |
30 BrowserContextDependencyManager::GetInstance()) {} | |
31 | |
32 FeedbackUploaderFactory::~FeedbackUploaderFactory() {} | |
33 | |
34 KeyedService* FeedbackUploaderFactory::BuildServiceInstanceFor( | |
35 content::BrowserContext* context) const { | |
36 return new FeedbackUploaderChrome(context); | |
37 } | |
38 | |
39 content::BrowserContext* FeedbackUploaderFactory::GetBrowserContextToUse( | |
40 content::BrowserContext* context) const { | |
41 return chrome::GetBrowserContextOwnInstanceInIncognito(context); | |
42 } | |
43 | |
44 } // namespace feedback | |
OLD | NEW |