diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-03 23:18:34 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-03 23:18:34 +0000 |
commit | 018bf658250915fd117e75b81e27a321f081ef8c (patch) | |
tree | b7217ea06f10ba62e78414161ad099082124e3e9 /chrome/browser/predictors | |
parent | 843e2e8a17bf20d8af604ed7d217ff1d28b88937 (diff) | |
download | chromium_src-018bf658250915fd117e75b81e27a321f081ef8c.zip chromium_src-018bf658250915fd117e75b81e27a321f081ef8c.tar.gz chromium_src-018bf658250915fd117e75b81e27a321f081ef8c.tar.bz2 |
Change GetProfileToUse method from Profile to content::BrowserContext
This drops a dependency on Profile in the interface of ProfileKeyedService
infrastructure, and adds helper functions that make it explicit what is being
done (it's not obvious just from "return context" for example that this will
result in the service having its own instance in Incognito mode instead
of no instance).
BUG=227219
R=erg@chromium.org, joi@chromium.org
Review URL: https://codereview.chromium.org/13865012
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@198232 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/predictors')
-rw-r--r-- | chrome/browser/predictors/autocomplete_action_predictor_factory.cc | 8 | ||||
-rw-r--r-- | chrome/browser/predictors/autocomplete_action_predictor_factory.h | 3 |
2 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/predictors/autocomplete_action_predictor_factory.cc b/chrome/browser/predictors/autocomplete_action_predictor_factory.cc index e57fc1f..b5361c1 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor_factory.cc +++ b/chrome/browser/predictors/autocomplete_action_predictor_factory.cc @@ -7,6 +7,7 @@ #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 "chrome/browser/profiles/profile_dependency_manager.h" @@ -34,9 +35,10 @@ AutocompleteActionPredictorFactory::AutocompleteActionPredictorFactory() AutocompleteActionPredictorFactory::~AutocompleteActionPredictorFactory() {} -bool -AutocompleteActionPredictorFactory::ServiceHasOwnInstanceInIncognito() const { - return true; +content::BrowserContext* +AutocompleteActionPredictorFactory::GetBrowserContextToUse( + content::BrowserContext* context) const { + return chrome::GetBrowserContextOwnInstanceInIncognito(context); } ProfileKeyedService* diff --git a/chrome/browser/predictors/autocomplete_action_predictor_factory.h b/chrome/browser/predictors/autocomplete_action_predictor_factory.h index 427f6ec..b1624ab 100644 --- a/chrome/browser/predictors/autocomplete_action_predictor_factory.h +++ b/chrome/browser/predictors/autocomplete_action_predictor_factory.h @@ -29,7 +29,8 @@ class AutocompleteActionPredictorFactory : public ProfileKeyedServiceFactory { virtual ~AutocompleteActionPredictorFactory(); // ProfileKeyedServiceFactory: - virtual bool ServiceHasOwnInstanceInIncognito() const OVERRIDE; + virtual content::BrowserContext* GetBrowserContextToUse( + content::BrowserContext* context) const OVERRIDE; virtual ProfileKeyedService* BuildServiceInstanceFor( content::BrowserContext* profile) const OVERRIDE; |