| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 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 "components/payments/content/can_make_payment_query_factory.h" |
| 6 |
| 7 #include "base/memory/singleton.h" |
| 8 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 9 #include "components/payments/core/can_make_payment_query.h" |
| 10 |
| 11 namespace payments { |
| 12 |
| 13 // static |
| 14 CanMakePaymentQueryFactory* CanMakePaymentQueryFactory::GetInstance() { |
| 15 return base::Singleton<CanMakePaymentQueryFactory>::get(); |
| 16 } |
| 17 |
| 18 CanMakePaymentQuery* CanMakePaymentQueryFactory::GetForContext( |
| 19 content::BrowserContext* context) { |
| 20 return static_cast<CanMakePaymentQuery*>( |
| 21 GetInstance()->GetServiceForBrowserContext(context, true)); |
| 22 } |
| 23 |
| 24 CanMakePaymentQueryFactory::CanMakePaymentQueryFactory() |
| 25 : BrowserContextKeyedServiceFactory( |
| 26 "CanMakePaymentQuery", |
| 27 BrowserContextDependencyManager::GetInstance()) {} |
| 28 |
| 29 CanMakePaymentQueryFactory::~CanMakePaymentQueryFactory() {} |
| 30 |
| 31 KeyedService* CanMakePaymentQueryFactory::BuildServiceInstanceFor( |
| 32 content::BrowserContext* context) const { |
| 33 return new CanMakePaymentQuery; |
| 34 } |
| 35 |
| 36 } // namespace payments |
| OLD | NEW |