This source file includes following definitions.
- GetForProfile
- GetInstance
- GetBrowserContextToUse
- BuildServiceInstanceFor
#include "chrome/browser/predictors/autocomplete_action_predictor_factory.h"
#include "chrome/browser/history/history_service_factory.h"
#include "chrome/browser/predictors/autocomplete_action_predictor.h"
#include "chrome/browser/predictors/predictor_database_factory.h"
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
namespace predictors {
AutocompleteActionPredictor* AutocompleteActionPredictorFactory::GetForProfile(
Profile* profile) {
return static_cast<AutocompleteActionPredictor*>(
GetInstance()->GetServiceForBrowserContext(profile, true));
}
AutocompleteActionPredictorFactory*
AutocompleteActionPredictorFactory::GetInstance() {
return Singleton<AutocompleteActionPredictorFactory>::get();
}
AutocompleteActionPredictorFactory::AutocompleteActionPredictorFactory()
: BrowserContextKeyedServiceFactory(
"AutocompleteActionPredictor",
BrowserContextDependencyManager::GetInstance()) {
DependsOn(HistoryServiceFactory::GetInstance());
DependsOn(PredictorDatabaseFactory::GetInstance());
}
AutocompleteActionPredictorFactory::~AutocompleteActionPredictorFactory() {}
content::BrowserContext*
AutocompleteActionPredictorFactory::GetBrowserContextToUse(
content::BrowserContext* context) const {
return chrome::GetBrowserContextOwnInstanceInIncognito(context);
}
KeyedService* AutocompleteActionPredictorFactory::BuildServiceInstanceFor(
content::BrowserContext* profile) const {
return new AutocompleteActionPredictor(static_cast<Profile*>(profile));
}
}