/chromium-webcl/src/chrome/browser/profiles/gaia_info_update_service_factory.h

https://bitbucket.org/peixuan/chromium_r197479_base · C Header · 44 lines · 22 code · 11 blank · 11 comment · 0 complexity · bd3ec357fcf80255a286d9ac3c8433a5 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_PROFILES_GAIA_INFO_UPDATE_SERVICE_FACTORY_H_
  5. #define CHROME_BROWSER_PROFILES_GAIA_INFO_UPDATE_SERVICE_FACTORY_H_
  6. #include "base/memory/singleton.h"
  7. #include "chrome/browser/profiles/profile_keyed_service_factory.h"
  8. class GAIAInfoUpdateService;
  9. class PrefRegistrySyncable;
  10. class Profile;
  11. // Singleton that owns all GAIAInfoUpdateServices and associates them with
  12. // Profiles. Listens for the Profile's destruction notification and cleans up
  13. // the associated GAIAInfoUpdateService.
  14. class GAIAInfoUpdateServiceFactory : public ProfileKeyedServiceFactory {
  15. public:
  16. // Returns the instance of GAIAInfoUpdateService associated with this profile
  17. // (creating one if none exists). Returns NULL if this profile cannot have a
  18. // GAIAInfoUpdateService (for example, if |profile| is incognito).
  19. static GAIAInfoUpdateService* GetForProfile(Profile* profile);
  20. // Returns an instance of the GAIAInfoUpdateServiceFactory singleton.
  21. static GAIAInfoUpdateServiceFactory* GetInstance();
  22. private:
  23. friend struct DefaultSingletonTraits<GAIAInfoUpdateServiceFactory>;
  24. GAIAInfoUpdateServiceFactory();
  25. virtual ~GAIAInfoUpdateServiceFactory();
  26. // ProfileKeyedServiceFactory:
  27. virtual ProfileKeyedService* BuildServiceInstanceFor(
  28. content::BrowserContext* context) const OVERRIDE;
  29. virtual void RegisterUserPrefs(PrefRegistrySyncable* registry) OVERRIDE;
  30. virtual bool ServiceIsNULLWhileTesting() const OVERRIDE;
  31. DISALLOW_COPY_AND_ASSIGN(GAIAInfoUpdateServiceFactory);
  32. };
  33. #endif // CHROME_BROWSER_PROFILES_GAIA_INFO_UPDATE_SERVICE_FACTORY_H_