| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" | 5 #include "components/keyed_service/content/browser_context_keyed_service_factory
.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 9 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 10 #include "components/keyed_service/core/keyed_service.h" | 10 #include "components/keyed_service/core/keyed_service.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 KeyedService* BrowserContextKeyedServiceFactory::GetServiceForBrowserContext( | 42 KeyedService* BrowserContextKeyedServiceFactory::GetServiceForBrowserContext( |
| 43 content::BrowserContext* context, | 43 content::BrowserContext* context, |
| 44 bool create) { | 44 bool create) { |
| 45 return KeyedServiceFactory::GetServiceForContext(context, create); | 45 return KeyedServiceFactory::GetServiceForContext(context, create); |
| 46 } | 46 } |
| 47 | 47 |
| 48 content::BrowserContext* | 48 content::BrowserContext* |
| 49 BrowserContextKeyedServiceFactory::GetBrowserContextToUse( | 49 BrowserContextKeyedServiceFactory::GetBrowserContextToUse( |
| 50 content::BrowserContext* context) const { | 50 content::BrowserContext* context) const { |
| 51 // TODO(crbug.com/701326): This DCHECK should be moved to GetContextToUse(). | 51 // TODO(crbug.com/701326): This DCHECK should be moved to GetContextToUse(). |
| 52 DCHECK(CalledOnValidThread()); | 52 DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); |
| 53 | 53 |
| 54 // Safe default for Incognito mode: no service. | 54 // Safe default for Incognito mode: no service. |
| 55 if (context->IsOffTheRecord()) | 55 if (context->IsOffTheRecord()) |
| 56 return nullptr; | 56 return nullptr; |
| 57 | 57 |
| 58 return context; | 58 return context; |
| 59 } | 59 } |
| 60 | 60 |
| 61 void | 61 void |
| 62 BrowserContextKeyedServiceFactory::RegisterUserPrefsOnBrowserContextForTest( | 62 BrowserContextKeyedServiceFactory::RegisterUserPrefsOnBrowserContextForTest( |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 114 |
| 115 void BrowserContextKeyedServiceFactory::ContextDestroyed( | 115 void BrowserContextKeyedServiceFactory::ContextDestroyed( |
| 116 base::SupportsUserData* context) { | 116 base::SupportsUserData* context) { |
| 117 BrowserContextDestroyed(static_cast<content::BrowserContext*>(context)); | 117 BrowserContextDestroyed(static_cast<content::BrowserContext*>(context)); |
| 118 } | 118 } |
| 119 | 119 |
| 120 void BrowserContextKeyedServiceFactory::RegisterPrefs( | 120 void BrowserContextKeyedServiceFactory::RegisterPrefs( |
| 121 user_prefs::PrefRegistrySyncable* registry) { | 121 user_prefs::PrefRegistrySyncable* registry) { |
| 122 RegisterProfilePrefs(registry); | 122 RegisterProfilePrefs(registry); |
| 123 } | 123 } |
| OLD | NEW |