/chromium-webcl/src/chrome/browser/autocomplete/autocomplete_classifier_factory.h

https://bitbucket.org/peixuan/chromium_r197479_base · C Header · 42 lines · 24 code · 11 blank · 7 comment · 0 complexity · 80ce73ee6c3e912cb42cab035de43494 MD5 · raw file

  1. // Copyright (c) 2012 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CLASSIFIER_FACTORY_H_
  5. #define CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CLASSIFIER_FACTORY_H_
  6. #include "base/basictypes.h"
  7. #include "base/memory/singleton.h"
  8. #include "chrome/browser/profiles/profile_keyed_service_factory.h"
  9. class AutocompleteClassifier;
  10. class Profile;
  11. // Singleton that owns all AutocompleteClassifiers and associates them with
  12. // Profiles.
  13. class AutocompleteClassifierFactory : public ProfileKeyedServiceFactory {
  14. public:
  15. // Returns the AutocompleteClassifier for |profile|.
  16. static AutocompleteClassifier* GetForProfile(Profile* profile);
  17. static AutocompleteClassifierFactory* GetInstance();
  18. static ProfileKeyedService* BuildInstanceFor(
  19. content::BrowserContext* profile);
  20. private:
  21. friend struct DefaultSingletonTraits<AutocompleteClassifierFactory>;
  22. AutocompleteClassifierFactory();
  23. virtual ~AutocompleteClassifierFactory();
  24. // ProfileKeyedServiceFactory:
  25. virtual bool ServiceRedirectedInIncognito() const OVERRIDE;
  26. virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
  27. virtual ProfileKeyedService* BuildServiceInstanceFor(
  28. content::BrowserContext* profile) const OVERRIDE;
  29. DISALLOW_COPY_AND_ASSIGN(AutocompleteClassifierFactory);
  30. };
  31. #endif // CHROME_BROWSER_AUTOCOMPLETE_AUTOCOMPLETE_CLASSIFIER_FACTORY_H_