Cast: Stop logging kVideoFrameSentToEncoder and rename a couple events.
[chromium-blink-merge.git] / chrome / browser / feedback / feedback_uploader_factory.cc
blobbc20ecc7428d724730abacd2f85cfef4f80a08a6
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/feedback/feedback_uploader_chrome.h"
10 #include "chrome/browser/profiles/incognito_helpers.h"
11 #include "components/keyed_service/content/browser_context_dependency_manager.h"
13 namespace feedback {
15 // static
16 FeedbackUploaderFactory* FeedbackUploaderFactory::GetInstance() {
17 return Singleton<FeedbackUploaderFactory>::get();
20 // static
21 FeedbackUploader* FeedbackUploaderFactory::GetForBrowserContext(
22 content::BrowserContext* context) {
23 return static_cast<FeedbackUploaderChrome*>(
24 GetInstance()->GetServiceForBrowserContext(context, true));
27 FeedbackUploaderFactory::FeedbackUploaderFactory()
28 : BrowserContextKeyedServiceFactory(
29 "feedback::FeedbackUploader",
30 BrowserContextDependencyManager::GetInstance()) {}
32 FeedbackUploaderFactory::~FeedbackUploaderFactory() {}
34 KeyedService* FeedbackUploaderFactory::BuildServiceInstanceFor(
35 content::BrowserContext* context) const {
36 return new FeedbackUploaderChrome(context);
39 content::BrowserContext* FeedbackUploaderFactory::GetBrowserContextToUse(
40 content::BrowserContext* context) const {
41 return chrome::GetBrowserContextOwnInstanceInIncognito(context);
44 } // namespace feedback