Index: extensions/browser/browser_context_keyed_api_factory.h |
diff --git a/extensions/browser/browser_context_keyed_api_factory.h b/extensions/browser/browser_context_keyed_api_factory.h |
index fc0add240e066d5b81ea510ee7b1d2e4d44872b4..ad87e22d84b0754f0c23b46d36380ecea9dcf325 100644 |
--- a/extensions/browser/browser_context_keyed_api_factory.h |
+++ b/extensions/browser/browser_context_keyed_api_factory.h |
@@ -76,6 +76,11 @@ class BrowserContextKeyedAPIFactory : public BrowserContextKeyedServiceFactory { |
T::GetFactoryInstance()->GetServiceForBrowserContext(context, true)); |
} |
+ static T* GetIfExists(content::BrowserContext* context) { |
+ return static_cast<T*>( |
+ T::GetFactoryInstance()->GetServiceForBrowserContext(context, false)); |
+ } |
+ |
// Declare dependencies on other factories. |
// By default, ExtensionSystemFactory is the only dependency; however, |
// specializations can override this. Declare your specialization in |