saved_files_service_factory.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #ifndef APPS_SAVED_FILES_SERVICE_FACTORY_H_
  5. #define APPS_SAVED_FILES_SERVICE_FACTORY_H_
  6. #include "base/memory/singleton.h"
  7. #include "components/keyed_service/content/browser_context_keyed_service_factory.h"
  8. namespace content {
  9. class BrowserContext;
  10. }
  11. namespace apps {
  12. class SavedFilesService;
  13. // BrowserContextKeyedServiceFactory for SavedFilesService.
  14. class SavedFilesServiceFactory : public BrowserContextKeyedServiceFactory {
  15. public:
  16. static SavedFilesService* GetForBrowserContext(
  17. content::BrowserContext* context);
  18. static SavedFilesService* GetForBrowserContextIfExists(
  19. content::BrowserContext* context);
  20. static SavedFilesServiceFactory* GetInstance();
  21. SavedFilesServiceFactory(const SavedFilesServiceFactory&) = delete;
  22. SavedFilesServiceFactory& operator=(const SavedFilesServiceFactory&) = delete;
  23. private:
  24. SavedFilesServiceFactory();
  25. ~SavedFilesServiceFactory() override;
  26. friend struct base::DefaultSingletonTraits<SavedFilesServiceFactory>;
  27. KeyedService* BuildServiceInstanceFor(
  28. content::BrowserContext* context) const override;
  29. content::BrowserContext* GetBrowserContextToUse(
  30. content::BrowserContext* context) const override;
  31. };
  32. } // namespace apps
  33. #endif // APPS_SAVED_FILES_SERVICE_FACTORY_H_