| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 #include "chrome/browser/enhanced_bookmarks/android/bookmark_image_service_andro
id.h" | |
| 6 #include "chrome/browser/enhanced_bookmarks/android/bookmark_image_service_facto
ry.h" | |
| 7 #include "components/keyed_service/content/browser_context_dependency_manager.h" | |
| 8 #include "content/public/browser/browser_context.h" | |
| 9 | |
| 10 namespace enhanced_bookmarks { | |
| 11 | |
| 12 // static | |
| 13 BookmarkImageServiceFactory* BookmarkImageServiceFactory::GetInstance() { | |
| 14 return Singleton<BookmarkImageServiceFactory>::get(); | |
| 15 } | |
| 16 | |
| 17 // static | |
| 18 BookmarkImageService* BookmarkImageServiceFactory::GetForBrowserContext( | |
| 19 content::BrowserContext* context) { | |
| 20 return static_cast<BookmarkImageService*>( | |
| 21 GetInstance()->GetServiceForBrowserContext(context, true)); | |
| 22 } | |
| 23 | |
| 24 BookmarkImageServiceFactory::BookmarkImageServiceFactory() | |
| 25 : BrowserContextKeyedServiceFactory( | |
| 26 "BookmarkExtendedStorageService", | |
| 27 BrowserContextDependencyManager::GetInstance()) {} | |
| 28 | |
| 29 BookmarkImageServiceFactory::~BookmarkImageServiceFactory() {} | |
| 30 | |
| 31 content::BrowserContext* BookmarkImageServiceFactory::GetBrowserContextToUse( | |
| 32 content::BrowserContext* context) const { | |
| 33 return context; | |
| 34 } | |
| 35 | |
| 36 BookmarkImageService* BookmarkImageServiceFactory::BuildServiceInstanceFor( | |
| 37 content::BrowserContext* browser_context) const { | |
| 38 return new BookmarkImageServiceAndroid(browser_context); | |
| 39 } | |
| 40 | |
| 41 } // namespace enhanced_bookmarks | |
| OLD | NEW |