Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6205)

Unified Diff: chrome/browser/search/hotword_service_factory.cc

Issue 174513003: Move ProfileKeyedAPI implementations to take BrowserContext in the constructor (part 3). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
}
« no previous file with comments | « chrome/browser/search/hotword_service_factory.h ('k') | chrome/browser/speech/extension_api/tts_extension_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698