1 // Copyright 2014 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 "components/feedback/feedback_uploader_factory.h"
7 #include "base/memory/singleton.h"
8 #include "components/feedback/feedback_uploader.h"
9 #include "components/feedback/feedback_uploader_chrome.h"
10 #include "components/keyed_service/content/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<FeedbackUploaderChrome
*>(
23 GetInstance()->GetServiceForBrowserContext(context
, true));
26 FeedbackUploaderFactory::FeedbackUploaderFactory()
27 : BrowserContextKeyedServiceFactory(
28 "feedback::FeedbackUploader",
29 BrowserContextDependencyManager::GetInstance()) {}
31 FeedbackUploaderFactory::~FeedbackUploaderFactory() {}
33 KeyedService
* FeedbackUploaderFactory::BuildServiceInstanceFor(
34 content::BrowserContext
* context
) const {
35 return new FeedbackUploaderChrome(context
);
38 content::BrowserContext
* FeedbackUploaderFactory::GetBrowserContextToUse(
39 content::BrowserContext
* context
) const {
43 } // namespace feedback