diff options
author | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-12 01:07:48 +0000 |
---|---|---|
committer | pkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-12 01:07:48 +0000 |
commit | 810ffba3ed8a53fa627aa746285ec63a9d192f60 (patch) | |
tree | a437e1d4c37104b8b12de0607504d28f516de421 /chrome/browser/autocomplete/autocomplete_classifier_factory.h | |
parent | 8e9f1b72aa231c6be1f07f44db6479ffa0b9692d (diff) | |
download | chromium_src-810ffba3ed8a53fa627aa746285ec63a9d192f60.zip chromium_src-810ffba3ed8a53fa627aa746285ec63a9d192f60.tar.gz chromium_src-810ffba3ed8a53fa627aa746285ec63a9d192f60.tar.bz2 |
Make AutocompleteClassifier a ProfileKeyedService.
This also cleans up some usage of TemplateURLServiceFactory, especially in order to remove knowledge of TemplateURLService[Factory] from TestingProfile. The changes for this parallel some implementation details for the AutocompleteClassifierFactory.
BUG=112557
TEST=none
Review URL: https://chromiumcodereview.appspot.com/10532096
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141580 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_classifier_factory.h')
-rwxr-xr-x | chrome/browser/autocomplete/autocomplete_classifier_factory.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_classifier_factory.h b/chrome/browser/autocomplete/autocomplete_classifier_factory.h new file mode 100755 index 0000000..70cd19c --- /dev/null +++ b/chrome/browser/autocomplete/autocomplete_classifier_factory.h @@ -0,0 +1,41 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CLASSIFIER_FACTORY_H_ +#define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CLASSIFIER_FACTORY_H_ + +#include "base/basictypes.h" +#include "base/memory/singleton.h" +#include "chrome/browser/profiles/profile_keyed_service_factory.h" + +class AutocompleteClassifier; +class Profile; + +// Singleton that owns all AutocompleteClassifiers and associates them with +// Profiles. +class AutocompleteClassifierFactory : public ProfileKeyedServiceFactory { + public: + // Returns the AutocompleteClassifier for |profile|. + static AutocompleteClassifier* GetForProfile(Profile* profile); + + static AutocompleteClassifierFactory* GetInstance(); + + static ProfileKeyedService* BuildInstanceFor(Profile* profile); + + private: + friend struct DefaultSingletonTraits<AutocompleteClassifierFactory>; + + AutocompleteClassifierFactory(); + virtual ~AutocompleteClassifierFactory(); + + // ProfileKeyedServiceFactory: + virtual bool ServiceRedirectedInIncognito() OVERRIDE; + virtual bool ServiceIsNULLWhileTesting() OVERRIDE; + virtual ProfileKeyedService* BuildServiceInstanceFor( + Profile* profile) const OVERRIDE; + + DISALLOW_COPY_AND_ASSIGN(AutocompleteClassifierFactory); +}; + +#endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CLASSIFIER_FACTORY_H_ |