• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2013 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 
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_SPELLCHECK_SPELLCHECK_API_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_SPELLCHECK_SPELLCHECK_API_H_
7 
8 #include "chrome/browser/extensions/api/profile_keyed_api_factory.h"
9 #include "content/public/browser/notification_observer.h"
10 #include "content/public/browser/notification_registrar.h"
11 
12 class Profile;
13 
14 namespace extensions {
15 
16 class SpellcheckAPI : public ProfileKeyedAPI,
17                       public content::NotificationObserver {
18  public:
19   explicit SpellcheckAPI(Profile* profile);
20   virtual ~SpellcheckAPI();
21 
22   // ProfileKeyedAPI implementation.
23   static ProfileKeyedAPIFactory<SpellcheckAPI>* GetFactoryInstance();
24 
25  private:
26   friend class ProfileKeyedAPIFactory<SpellcheckAPI>;
27 
28   // content::NotificationDelegate implementation.
29   virtual void Observe(int type,
30                        const content::NotificationSource& source,
31                        const content::NotificationDetails& details) OVERRIDE;
32 
33   // ProfileKeyedAPI implementation.
service_name()34   static const char* service_name() {
35     return "SpellcheckAPI";
36   }
37 
38   content::NotificationRegistrar registrar_;
39 
40   DISALLOW_COPY_AND_ASSIGN(SpellcheckAPI);
41 };
42 
43 template <>
44 void ProfileKeyedAPIFactory<SpellcheckAPI>::DeclareFactoryDependencies();
45 
46 }  // namespace extensions
47 
48 #endif  // CHROME_BROWSER_EXTENSIONS_API_SPELLCHECK_SPELLCHECK_API_H_
49