Index: chrome/browser/search/hotword_service_factory.cc |
diff --git a/chrome/browser/search/hotword_service_factory.cc b/chrome/browser/search/hotword_service_factory.cc |
index 571b4b334592e4559720a7e2abaf2bc1f1997f93..eb795533eeb068e42cc1983e7fdee5a3d67df1f4 100644 |
--- a/chrome/browser/search/hotword_service_factory.cc |
+++ b/chrome/browser/search/hotword_service_factory.cc |
@@ -5,17 +5,19 @@ |
#include "chrome/browser/search/hotword_service_factory.h" |
#include "base/prefs/pref_service.h" |
-#include "chrome/browser/profiles/incognito_helpers.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/search/hotword_service.h" |
#include "chrome/common/pref_names.h" |
#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" |
#include "components/user_prefs/pref_registry_syncable.h" |
+#include "content/public/browser/browser_context.h" |
+ |
+using content::BrowserContext; |
// static |
-HotwordService* HotwordServiceFactory::GetForProfile(Profile* profile) { |
+HotwordService* HotwordServiceFactory::GetForProfile(BrowserContext* context) { |
return static_cast<HotwordService*>( |
- GetInstance()->GetServiceForBrowserContext(profile, true)); |
+ GetInstance()->GetServiceForBrowserContext(context, true)); |
} |
// static |
@@ -24,20 +26,20 @@ HotwordServiceFactory* HotwordServiceFactory::GetInstance() { |
} |
// static |
-bool HotwordServiceFactory::ShouldShowOptInPopup(Profile* profile) { |
- HotwordService* hotword_service = GetForProfile(profile); |
+bool HotwordServiceFactory::ShouldShowOptInPopup(BrowserContext* context) { |
+ HotwordService* hotword_service = GetForProfile(context); |
return hotword_service && hotword_service->ShouldShowOptInPopup(); |
} |
// static |
-bool HotwordServiceFactory::IsServiceAvailable(Profile* profile) { |
- HotwordService* hotword_service = GetForProfile(profile); |
+bool HotwordServiceFactory::IsServiceAvailable(BrowserContext* context) { |
+ HotwordService* hotword_service = GetForProfile(context); |
return hotword_service && hotword_service->IsServiceAvailable(); |
} |
// static |
-bool HotwordServiceFactory::IsHotwordAllowed(Profile* profile) { |
- HotwordService* hotword_service = GetForProfile(profile); |
+bool HotwordServiceFactory::IsHotwordAllowed(BrowserContext* context) { |
+ HotwordService* hotword_service = GetForProfile(context); |
return hotword_service && hotword_service->IsHotwordAllowed(); |
} |
@@ -62,6 +64,6 @@ void HotwordServiceFactory::RegisterProfilePrefs( |
} |
BrowserContextKeyedService* HotwordServiceFactory::BuildServiceInstanceFor( |
- content::BrowserContext* profile) const { |
- return new HotwordService(static_cast<Profile*>(profile)); |
+ BrowserContext* context) const { |
+ return new HotwordService(Profile::FromBrowserContext(context)); |
} |