Upstreaming browser/ui/uikit_ui_util from iOS.
[chromium-blink-merge.git] / ios / chrome / browser / enhanced_bookmarks / bookmark_image_service_factory.h
blobedc0e64f95c07588ec20c5d5faede769714150bb
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 IOS_CHROME_BROWSER_ENHANCED_BOOKMARKS_BOOKMARK_IMAGE_SERVICE_FACTORY_H_
6 #define IOS_CHROME_BROWSER_ENHANCED_BOOKMARKS_BOOKMARK_IMAGE_SERVICE_FACTORY_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h"
12 template <typename T>
13 struct DefaultSingletonTraits;
15 namespace ios {
16 class ChromeBrowserState;
19 class BookmarkImageServiceIOS;
21 // Singleton that owns all BookmarkImageServices and associates them with
22 // ChromeBrowserStates.
23 class BookmarkImageServiceFactory : public BrowserStateKeyedServiceFactory {
24 public:
25 static BookmarkImageServiceIOS* GetForBrowserState(
26 ios::ChromeBrowserState* browser_state);
27 static BookmarkImageServiceFactory* GetInstance();
29 private:
30 friend struct DefaultSingletonTraits<BookmarkImageServiceFactory>;
32 BookmarkImageServiceFactory();
33 ~BookmarkImageServiceFactory() override;
35 // BrowserStateKeyedServiceFactory implementation.
36 scoped_ptr<KeyedService> BuildServiceInstanceFor(
37 web::BrowserState* context) const override;
38 web::BrowserState* GetBrowserStateToUse(
39 web::BrowserState* context) const override;
41 DISALLOW_COPY_AND_ASSIGN(BookmarkImageServiceFactory);
44 #endif // IOS_CHROME_BROWSER_ENHANCED_BOOKMARKS_BOOKMARK_IMAGE_SERVICE_FACTORY_H_