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.
5 #include "chrome/browser/feedback/feedback_uploader_factory.h"
7 #include "base/memory/singleton.h"
8 #include "chrome/browser/feedback/feedback_uploader.h"
9 #include "chrome/browser/profiles/incognito_helpers.h"
10 #include "components/browser_context_keyed_service/browser_context_dependency_manager.h"
15 FeedbackUploaderFactory
* FeedbackUploaderFactory::GetInstance() {
16 return Singleton
<FeedbackUploaderFactory
>::get();
20 FeedbackUploader
* FeedbackUploaderFactory::GetForBrowserContext(
21 content::BrowserContext
* context
) {
22 return static_cast<FeedbackUploader
*>(
23 GetInstance()->GetServiceForBrowserContext(context
, true));
26 FeedbackUploaderFactory::FeedbackUploaderFactory()
27 : BrowserContextKeyedServiceFactory(
28 "feedback::FeedbackUploader",
29 BrowserContextDependencyManager::GetInstance()) {}
31 FeedbackUploaderFactory::~FeedbackUploaderFactory() {}
33 BrowserContextKeyedService
* FeedbackUploaderFactory::BuildServiceInstanceFor(
34 content::BrowserContext
* context
) const {
35 return new FeedbackUploader(context
);
38 content::BrowserContext
* FeedbackUploaderFactory::GetBrowserContextToUse(
39 content::BrowserContext
* context
) const {
40 return chrome::GetBrowserContextOwnInstanceInIncognito(context
);
43 } // namespace feedback