Chromium Code Reviews| Index: chrome/browser/favicon/fallback_icon_service_factory.h |
| diff --git a/chrome/browser/favicon/fallback_icon_service_factory.h b/chrome/browser/favicon/fallback_icon_service_factory.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4061352b5514cc905fe3efa9dcbb13eaba3496f3 |
| --- /dev/null |
| +++ b/chrome/browser/favicon/fallback_icon_service_factory.h |
| @@ -0,0 +1,45 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_FAVICON_FALLBACK_ICON_SERVICE_FACTORY_H_ |
| +#define CHROME_BROWSER_FAVICON_FALLBACK_ICON_SERVICE_FACTORY_H_ |
| + |
| +#include "base/memory/singleton.h" |
|
sdefresne
2015/03/17 09:41:52
No need for this #include since you forward-declar
huangs
2015/03/23 03:28:35
Done.
|
| +#include "components/keyed_service/content/browser_context_keyed_service_factory.h" |
| +#include "components/keyed_service/core/service_access_type.h" |
| + |
| +template <typename T> struct DefaultSingletonTraits; |
| + |
| +class Profile; |
| + |
| +namespace favicon_base { |
| +class FallbackIconService; |
| +} // namespace favicon_base |
| + |
| +// Singleton that owns all FallbackIconService and associates them with |
| +// Profiles. |
| +class FallbackIconServiceFactory : public BrowserContextKeyedServiceFactory { |
| + public: |
| + // |access| defines what the caller plans to do with the service. See |
| + // the ServiceAccessType definition in profile.h. |
| + static favicon_base::FallbackIconService* GetForProfile( |
| + Profile* profile, ServiceAccessType sat); |
| + |
| + static FallbackIconServiceFactory* GetInstance(); |
| + |
| + private: |
| + friend struct DefaultSingletonTraits<FallbackIconServiceFactory>; |
| + |
| + FallbackIconServiceFactory(); |
| + ~FallbackIconServiceFactory() override; |
| + |
| + // BrowserContextKeyedServiceFactory: |
| + KeyedService* BuildServiceInstanceFor( |
| + content::BrowserContext* profile) const override; |
| + bool ServiceIsNULLWhileTesting() const override; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(FallbackIconServiceFactory); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_FAVICON_FALLBACK_ICON_SERVICE_FACTORY_H_ |