| Index: chrome/browser/spellchecker/spellcheck_factory.h
|
| diff --git a/chrome/browser/spellchecker/spellcheck_factory.h b/chrome/browser/spellchecker/spellcheck_factory.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9ac98e7a2ac82dbd22f6326b125ba6aa3e0018ba
|
| --- /dev/null
|
| +++ b/chrome/browser/spellchecker/spellcheck_factory.h
|
| @@ -0,0 +1,52 @@
|
| +// 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_SPELLCHECKER_SPELLCHECK_FACTORY_H_
|
| +#define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_FACTORY_H_
|
| +#pragma once
|
| +
|
| +#include "base/basictypes.h"
|
| +#include "base/memory/singleton.h"
|
| +#include "chrome/browser/profiles/profile_keyed_service_factory.h"
|
| +
|
| +class SpellCheckHost;
|
| +class SpellCheckProfile;
|
| +
|
| +// Entry into the SpellCheck system.
|
| +//
|
| +// Internally, this owns all SpellCheckProfile objects, but these aren't
|
| +// exposed to the callers. Instead, the SpellCheckProfile may or may not hand
|
| +// out SpellCheckHost objects for consumption outside the SpellCheck system.
|
| +class SpellCheckFactory : public ProfileKeyedServiceFactory {
|
| + public:
|
| + // Returns the spell check host. This may be NULL.
|
| + static SpellCheckHost* GetHostForProfile(Profile* profile);
|
| +
|
| + // If |force| is false, and the spellchecker is already initialized (or is in
|
| + // the process of initializing), then do nothing. Otherwise clobber the
|
| + // current spellchecker and replace it with a new one.
|
| + static void ReinitializeSpellCheckHost(Profile* profile, bool force);
|
| +
|
| + static SpellCheckFactory* GetInstance();
|
| +
|
| + private:
|
| + friend struct DefaultSingletonTraits<SpellCheckFactory>;
|
| +
|
| + SpellCheckFactory();
|
| + virtual ~SpellCheckFactory();
|
| +
|
| + // Fetches the internal object for |profile|.
|
| + SpellCheckProfile* GetSpellCheckProfile(Profile* profile);
|
| +
|
| + // ProfileKeyedServiceFactory:
|
| + virtual ProfileKeyedService* BuildServiceInstanceFor(
|
| + Profile* profile) const OVERRIDE;
|
| + virtual void RegisterUserPrefs(PrefService* user_prefs) OVERRIDE;
|
| + virtual bool ServiceRedirectedInIncognito() OVERRIDE;
|
| + virtual bool ServiceIsNULLWhileTesting() OVERRIDE;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(SpellCheckFactory);
|
| +};
|
| +
|
| +#endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_FACTORY_H_
|
|
|