Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / components / feedback / feedback_uploader_factory.h
blobae99d370e0a511c24876e28198824c295335175e
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 #ifndef COMPONENTS_FEEDBACK_FEEDBACK_UPLOADER_FACTORY_H_
6 #define COMPONENTS_FEEDBACK_FEEDBACK_UPLOADER_FACTORY_H_
8 #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
10 namespace base {
11 template<typename T> struct DefaultSingletonTraits;
14 namespace content {
15 class BrowserContext;
18 namespace feedback {
20 class FeedbackUploader;
22 // Singleton that owns the FeedbackUploaders and associates them with profiles;
23 class FeedbackUploaderFactory : public BrowserContextKeyedServiceFactory {
24 public:
25 // Returns singleton instance of FeedbackUploaderFactory.
26 static FeedbackUploaderFactory* GetInstance();
28 // Returns the Feedback Uploader associated with |context|.
29 static FeedbackUploader* GetForBrowserContext(
30 content::BrowserContext* context);
32 private:
33 friend struct base::DefaultSingletonTraits<FeedbackUploaderFactory>;
35 FeedbackUploaderFactory();
36 ~FeedbackUploaderFactory() override;
38 // BrowserContextKeyedServiceFactory overrides:
39 KeyedService* BuildServiceInstanceFor(
40 content::BrowserContext* context) const override;
41 content::BrowserContext* GetBrowserContextToUse(
42 content::BrowserContext* context) const override;
44 DISALLOW_COPY_AND_ASSIGN(FeedbackUploaderFactory);
47 } // namespace feedback
49 #endif // COMPONENTS_FEEDBACK_FEEDBACK_UPLOADER_FACTORY_H_