| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #ifndef IOS_CHROME_BROWSER_ENHANCED_BOOKMARKS_BOOKMARK_IMAGE_SERVICE_FACTORY_H_ | |
| 6 #define IOS_CHROME_BROWSER_ENHANCED_BOOKMARKS_BOOKMARK_IMAGE_SERVICE_FACTORY_H_ | |
| 7 | |
| 8 #include "base/macros.h" | |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "components/keyed_service/ios/browser_state_keyed_service_factory.h" | |
| 11 | |
| 12 template <typename T> | |
| 13 struct DefaultSingletonTraits; | |
| 14 | |
| 15 namespace ios { | |
| 16 class ChromeBrowserState; | |
| 17 } | |
| 18 | |
| 19 class BookmarkImageServiceIOS; | |
| 20 | |
| 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(); | |
| 28 | |
| 29 private: | |
| 30 friend struct DefaultSingletonTraits<BookmarkImageServiceFactory>; | |
| 31 | |
| 32 BookmarkImageServiceFactory(); | |
| 33 ~BookmarkImageServiceFactory() override; | |
| 34 | |
| 35 // BrowserStateKeyedServiceFactory implementation. | |
| 36 scoped_ptr<KeyedService> BuildServiceInstanceFor( | |
| 37 web::BrowserState* context) const override; | |
| 38 web::BrowserState* GetBrowserStateToUse( | |
| 39 web::BrowserState* context) const override; | |
| 40 | |
| 41 DISALLOW_COPY_AND_ASSIGN(BookmarkImageServiceFactory); | |
| 42 }; | |
| 43 | |
| 44 #endif // IOS_CHROME_BROWSER_ENHANCED_BOOKMARKS_BOOKMARK_IMAGE_SERVICE_FACTORY_
H_ | |
| OLD | NEW |