1 // Copyright 2015 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 #include "chrome/browser/enhanced_bookmarks/android/bookmark_image_service_android.h"
6 #include "chrome/browser/enhanced_bookmarks/android/bookmark_image_service_factory.h"
7 #include "components/keyed_service/content/browser_context_dependency_manager.h"
8 #include "content/public/browser/browser_context.h"
10 namespace enhanced_bookmarks
{
13 BookmarkImageServiceFactory
* BookmarkImageServiceFactory::GetInstance() {
14 return Singleton
<BookmarkImageServiceFactory
>::get();
18 BookmarkImageService
* BookmarkImageServiceFactory::GetForBrowserContext(
19 content::BrowserContext
* context
) {
20 return static_cast<BookmarkImageService
*>(
21 GetInstance()->GetServiceForBrowserContext(context
, true));
24 BookmarkImageServiceFactory::BookmarkImageServiceFactory()
25 : BrowserContextKeyedServiceFactory(
26 "BookmarkExtendedStorageService",
27 BrowserContextDependencyManager::GetInstance()) {}
29 BookmarkImageServiceFactory::~BookmarkImageServiceFactory() {}
31 content::BrowserContext
* BookmarkImageServiceFactory::GetBrowserContextToUse(
32 content::BrowserContext
* context
) const {
36 BookmarkImageService
* BookmarkImageServiceFactory::BuildServiceInstanceFor(
37 content::BrowserContext
* browser_context
) const {
38 return new BookmarkImageServiceAndroid(browser_context
);
41 } // namespace enhanced_bookmarks